try this please diff --git a/cmd-if-shell.c b/cmd-if-shell.c index dddd5d4..d1cbd7f 100644 --- a/cmd-if-shell.c +++ b/cmd-if-shell.c @@ -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) diff --git a/cmd-run-shell.c b/cmd-run-shell.c index 4df21ff..7c7d333 100644 --- a/cmd-run-shell.c +++ b/cmd-run-shell.c @@ -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)
On Sat, Mar 23, 2013 at 11:14:23PM -0700, Aaron Jensen wrote: > bisect tells me this is the bad commit: > a6ad44f111a42553ad38a850a0e215914ea1f037 is the first bad commit > commit a6ad44f111a42553ad38a850a0e215914ea1f037 > Author: Nicholas Marriott <nicholas.marri...@gmail.com> > Date: Mon Mar 11 09:43:56 2013 +0000 > Fix if-shell and run-shell if there are no sessions. Batted around > through > several people, finished off by Chris Johnsen. > > On Saturday, March 23, 2013 at 11:05 PM, Aaron Jensen wrote: > > If I do this: > bind ^H run "tmux display-message '#{pane_title}'" > Then it will show blank instead of the current pane's title. It's as if > it loses the context of the current pane. And yes, I do need the `run`, > the real binding does more than this. > This seems to be a recent regression. > Thanks, > Aaron > ------------------------------------------------------------------------------ > Everyone hates slow websites. So do we. > Make your web apps faster with AppDynamics > Download AppDynamics Lite for free today: > http://p.sf.net/sfu/appdyn_d2d_mar > _______________________________________________ > tmux-users mailing list > tmux-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/tmux-users ------------------------------------------------------------------------------ Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_mar _______________________________________________ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users