diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2018-04-10 10:48:45 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2018-04-10 10:48:45 +0000 |
commit | 742eefdbef46eba88fc67e62bb1c6a3963dc19c8 (patch) | |
tree | c541f75ece70ffa29af6e307f3a817f2031ba04c /usr.bin/tmux/server-fn.c | |
parent | beaabf6cd8d215b34e13b596af794e10b6b7dd1d (diff) |
Add x and X to choose-tree (with a confirmation prompt) to kill an
item. Suggested by Matt Zagrabelny.
Diffstat (limited to 'usr.bin/tmux/server-fn.c')
-rw-r--r-- | usr.bin/tmux/server-fn.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/usr.bin/tmux/server-fn.c b/usr.bin/tmux/server-fn.c index 71a714e3b74..45433209a59 100644 --- a/usr.bin/tmux/server-fn.c +++ b/usr.bin/tmux/server-fn.c @@ -1,4 +1,4 @@ -/* $OpenBSD: server-fn.c,v 1.113 2018/02/28 08:55:44 nicm Exp $ */ +/* $OpenBSD: server-fn.c,v 1.114 2018/04/10 10:48:44 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -178,6 +178,22 @@ server_lock_client(struct client *c) } void +server_kill_pane(struct window_pane *wp) +{ + struct window *w = wp->window; + + if (window_count_panes(w) == 1) { + server_kill_window(w); + recalculate_sizes(); + } else { + server_unzoom_window(w); + layout_close_pane(wp); + window_remove_pane(w, wp); + server_redraw_window(w); + } +} + +void server_kill_window(struct window *w) { struct session *s, *next_s, *target_s; |