version 1.83, 2020/04/13 14:46:04 |
version 1.84, 2020/05/16 15:45:29 |
|
|
.name = "attach-session", |
.name = "attach-session", |
.alias = "attach", |
.alias = "attach", |
|
|
.args = { "c:dErt:x", 0, 0 }, |
.args = { "c:dEf:rt:x", 0, 0 }, |
.usage = "[-dErx] [-c working-directory] " CMD_TARGET_SESSION_USAGE, |
.usage = "[-dErx] [-c working-directory] [-f flags] " |
|
CMD_TARGET_SESSION_USAGE, |
|
|
/* -t is special */ |
/* -t is special */ |
|
|
|
|
|
|
enum cmd_retval |
enum cmd_retval |
cmd_attach_session(struct cmdq_item *item, const char *tflag, int dflag, |
cmd_attach_session(struct cmdq_item *item, const char *tflag, int dflag, |
int xflag, int rflag, const char *cflag, int Eflag) |
int xflag, int rflag, const char *cflag, int Eflag, const char *fflag) |
{ |
{ |
struct cmd_find_state *current = cmdq_get_current(item); |
struct cmd_find_state *current = cmdq_get_current(item); |
struct cmd_find_state target; |
struct cmd_find_state target; |
|
|
free((void *)s->cwd); |
free((void *)s->cwd); |
s->cwd = format_single(item, cflag, c, s, wl, wp); |
s->cwd = format_single(item, cflag, c, s, wl, wp); |
} |
} |
|
if (fflag) |
|
server_client_set_flags(c, fflag); |
|
if (rflag) |
|
c->flags |= (CLIENT_READONLY|CLIENT_IGNORESIZE); |
|
|
c->last_session = c->session; |
c->last_session = c->session; |
if (c->session != NULL) { |
if (c->session != NULL) { |
|
|
free(cause); |
free(cause); |
return (CMD_RETURN_ERROR); |
return (CMD_RETURN_ERROR); |
} |
} |
if (rflag) |
|
c->flags |= CLIENT_READONLY; |
|
|
|
if (dflag || xflag) { |
if (dflag || xflag) { |
if (xflag) |
if (xflag) |
|
|
|
|
return (cmd_attach_session(item, args_get(args, 't'), |
return (cmd_attach_session(item, args_get(args, 't'), |
args_has(args, 'd'), args_has(args, 'x'), args_has(args, 'r'), |
args_has(args, 'd'), args_has(args, 'x'), args_has(args, 'r'), |
args_get(args, 'c'), args_has(args, 'E'))); |
args_get(args, 'c'), args_has(args, 'E'), args_get(args, 'f'))); |
} |
} |