aboutsummaryrefslogtreecommitdiff
path: root/cmd-move-window.c
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2015-04-22 10:05:54 +0100
committerThomas Adam <thomas@xteddy.org>2015-04-22 10:05:54 +0100
commit0a88377086329786c438d4973365fdb21186f4e4 (patch)
treedf5b091b400df84974f58bbfbb78ee26ccb9a5f6 /cmd-move-window.c
parentb25dc423b0b1369aaec5dee8e051d541bd55043f (diff)
parent3909aff06aa6de748ae057cab1e723eec2387edd (diff)
downloadrtmux-0a88377086329786c438d4973365fdb21186f4e4.tar.gz
rtmux-0a88377086329786c438d4973365fdb21186f4e4.tar.bz2
rtmux-0a88377086329786c438d4973365fdb21186f4e4.zip
Merge branch 'obsd-master'
Diffstat (limited to 'cmd-move-window.c')
-rw-r--r--cmd-move-window.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/cmd-move-window.c b/cmd-move-window.c
index 3064cd6e..e765b625 100644
--- a/cmd-move-window.c
+++ b/cmd-move-window.c
@@ -51,7 +51,7 @@ cmd_move_window_exec(struct cmd *self, struct cmd_q *cmdq)
struct session *src, *dst, *s;
struct winlink *wl;
char *cause;
- int idx, kflag, dflag;
+ int idx, kflag, dflag, sflag;
if (args_has(args, 'r')) {
s = cmd_find_session(cmdq, args_get(args, 't'), 0);
@@ -71,6 +71,7 @@ cmd_move_window_exec(struct cmd *self, struct cmd_q *cmdq)
kflag = args_has(self->args, 'k');
dflag = args_has(self->args, 'd');
+ sflag = args_has(self->args, 's');
if (server_link_window(src, wl, dst, idx, kflag, !dflag,
&cause) != 0) {
cmdq_error(cmdq, "can't link window: %s", cause);
@@ -79,6 +80,15 @@ cmd_move_window_exec(struct cmd *self, struct cmd_q *cmdq)
}
if (self->entry == &cmd_move_window_entry)
server_unlink_window(src, wl);
+
+ /*
+ * Renumber the winlinks in the src session only, the destination
+ * session already has the correct winlink id to us, either
+ * automatically or specified by -s.
+ */
+ if (!sflag && options_get_number(&src->options, "renumber-windows"))
+ session_renumber_windows(src);
+
recalculate_sizes();
return (CMD_RETURN_NORMAL);