On Tue, May 08, 2012 at 12:13:13AM +0000, Ben Boeckel wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA512 > > On Tue, Apr 24, 2012 at 22:07:40 GMT, Thomas Adam wrote: > > diff --git a/trunk/cmd-move-window.c b/trunk/cmd-move-window.c > > index 5c4dbbe..acb5044 100644 > > --- a/trunk/cmd-move-window.c > > +++ b/trunk/cmd-move-window.c > > @@ -42,11 +42,22 @@ int > > cmd_move_window_exec(struct cmd *self, struct cmd_ctx *ctx) > > { > > struct args *args = self->args; > > - struct session *src, *dst; > > + struct session *src, *dst, *s; > > struct winlink *wl; > > char *cause; > > int idx, kflag, dflag; > > > > + if ((s = ctx->curclient->session) == NULL) > > + return (-1); > > + > > + if (args_has(args, 'r')) > > + { > > + session_renumber_windows(s); > > + recalculate_sizes(); > > + > > + return (0); > > + } > > + > > if ((wl = cmd_find_window(ctx, args_get(args, 's'), &src)) == NULL) > > return (-1); > > if ((idx = cmd_find_index(ctx, args_get(args, 't'), &dst)) == -2) > > This breaks external tmux controlling with move-window altogether.
It doesn't just break it; the tmux server crashes. ;) > There's no curclient outside of tmux itself. Should -s be taken into > account as a session when -r is around? Well, no, because the semantics for -s and -t in the context of move-window do more than just find the session, they find the winlink for both as well as the session (because you can use -s session:window notation.) So I am not sure how best do this, other than have -r take a parameter to specify a session, and use cmd_find_session() to look it up. -- Thomas Adam ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users