On 8 May 2012 10:04, Thomas Adam <[email protected]> wrote:
> 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.
Something like the following? Completely and utterly untested.
diff --git a/trunk/cmd-move-window.c b/trunk/cmd-move-window.c
index acb5044..6b17b82 100644
--- a/trunk/cmd-move-window.c
+++ b/trunk/cmd-move-window.c
@@ -30,7 +30,7 @@ int cmd_move_window_exec(struct cmd *, struct cmd_ctx *);
const struct cmd_entry cmd_move_window_entry = {
"move-window", "movew",
- "dkrs:t:", 0, 0,
+ "dkr:s:t:", 0, 0,
"[-dkr] " CMD_SRCDST_WINDOW_USAGE,
0,
NULL,
@@ -47,11 +47,11 @@ cmd_move_window_exec(struct cmd *self, struct cmd_ctx *ctx)
char *cause;
int idx, kflag, dflag;
- if ((s = ctx->curclient->session) == NULL)
- return (-1);
-
if (args_has(args, 'r'))
{
+ if ((s = cmd_find_session(ctx, args_get(args, 'r'), 0)) == NULL)
+ return (-1);
+
session_renumber_windows(s);
recalculate_sizes();
-- 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
[email protected]
https://lists.sourceforge.net/lists/listinfo/tmux-users