diff options
author | Thomas Adam <thomas@xteddy.org> | 2012-12-31 18:50:37 +0000 |
---|---|---|
committer | Thomas Adam <thomas@xteddy.org> | 2012-12-31 18:50:37 +0000 |
commit | 675c6b37734a622b4530d35505f897310fdb138c (patch) | |
tree | f604d1b678f6724d9dda28ce14a0efbcdf47a1f3 /cmd-select-window.c | |
parent | f4472c16b2b05914ed1d2eb4d5bbf9cd1929f77a (diff) | |
parent | 854e8ae04d15c16b688ba38119656aee134548dd (diff) | |
download | rtmux-675c6b37734a622b4530d35505f897310fdb138c.tar.gz rtmux-675c6b37734a622b4530d35505f897310fdb138c.tar.bz2 rtmux-675c6b37734a622b4530d35505f897310fdb138c.zip |
Merge branch 'obsd-master'
Sync from OpenBSD.
Diffstat (limited to 'cmd-select-window.c')
-rw-r--r-- | cmd-select-window.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/cmd-select-window.c b/cmd-select-window.c index 5d87e59a..aecb5b5a 100644 --- a/cmd-select-window.c +++ b/cmd-select-window.c @@ -31,8 +31,8 @@ enum cmd_retval cmd_select_window_exec(struct cmd *, struct cmd_ctx *); const struct cmd_entry cmd_select_window_entry = { "select-window", "selectw", - "lnpt:", 0, 0, - "[-lnp] " CMD_TARGET_WINDOW_USAGE, + "lnpTt:", 0, 0, + "[-lnpT] " CMD_TARGET_WINDOW_USAGE, 0, cmd_select_window_key_binding, NULL, @@ -130,7 +130,17 @@ cmd_select_window_exec(struct cmd *self, struct cmd_ctx *ctx) if (wl == NULL) return (CMD_RETURN_ERROR); - if (session_select(s, wl->idx) == 0) + /* + * If -T and select-window is invoked on same window as + * current, switch to previous window. + */ + if (args_has(self->args, 'T') && wl == s->curw) { + if (session_last(s) != 0) { + ctx->error(ctx, "no last window"); + return (-1); + } + server_redraw_session(s); + } else if (session_select(s, wl->idx) == 0) server_redraw_session(s); } recalculate_sizes(); |