-/* $OpenBSD: cmd-move-window.c,v 1.18 2014/10/27 22:40:29 nicm Exp $ */
+/* $OpenBSD: cmd-move-window.c,v 1.19 2015/04/21 21:24:49 nicm Exp $ */
/*
* Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
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);
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);
}
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);
-/* $OpenBSD: server-fn.c,v 1.81 2015/04/19 21:46:52 nicm Exp $ */
+/* $OpenBSD: server-fn.c,v 1.82 2015/04/21 21:24:49 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
server_destroy_session_group(s);
else
server_redraw_session_group(s);
- session_renumber_windows(s);
}
void