mirror of
https://github.com/tmate-io/tmate.git
synced 2024-11-26 10:03:08 +01:00
Try to establish client for run-shell and if-shell if no -t.
This commit is contained in:
parent
e44bd9f750
commit
972da2d498
@ -59,6 +59,7 @@ cmd_if_shell_exec(struct cmd *self, struct cmd_q *cmdq)
|
||||
struct args *args = self->args;
|
||||
struct cmd_if_shell_data *cdata;
|
||||
char *shellcmd;
|
||||
struct client *c;
|
||||
struct session *s = NULL;
|
||||
struct winlink *wl = NULL;
|
||||
struct window_pane *wp = NULL;
|
||||
@ -66,6 +67,14 @@ cmd_if_shell_exec(struct cmd *self, struct cmd_q *cmdq)
|
||||
|
||||
if (args_has(args, 't'))
|
||||
wl = cmd_find_pane(cmdq, args_get(args, 't'), &s, &wp);
|
||||
else {
|
||||
c = cmd_find_client(cmdq, NULL, 1);
|
||||
if (c != NULL && c->session != NULL) {
|
||||
s = c->session;
|
||||
wl = s->curw;
|
||||
wp = wl->window->active;
|
||||
}
|
||||
}
|
||||
|
||||
ft = format_create();
|
||||
if (s != NULL)
|
||||
|
@ -77,6 +77,7 @@ cmd_run_shell_exec(struct cmd *self, struct cmd_q *cmdq)
|
||||
struct args *args = self->args;
|
||||
struct cmd_run_shell_data *cdata;
|
||||
char *shellcmd;
|
||||
struct client *c;
|
||||
struct session *s = NULL;
|
||||
struct winlink *wl = NULL;
|
||||
struct window_pane *wp = NULL;
|
||||
@ -84,6 +85,14 @@ cmd_run_shell_exec(struct cmd *self, struct cmd_q *cmdq)
|
||||
|
||||
if (args_has(args, 't'))
|
||||
wl = cmd_find_pane(cmdq, args_get(args, 't'), &s, &wp);
|
||||
else {
|
||||
c = cmd_find_client(cmdq, NULL, 1);
|
||||
if (c != NULL && c->session != NULL) {
|
||||
s = c->session;
|
||||
wl = s->curw;
|
||||
wp = wl->window->active;
|
||||
}
|
||||
}
|
||||
|
||||
ft = format_create();
|
||||
if (s != NULL)
|
||||
|
Loading…
Reference in New Issue
Block a user