From 4471af109f3cb2bbcc025b391eeb4fd73e9ef415 Mon Sep 17 00:00:00 2001 From: nicm Date: Sun, 7 Jun 2026 08:25:59 +0000 Subject: [PATCH] Enable floating panes. These are panes which sit above the layout ("tiled panes") like popups but unlike popups are not modal and behave like panes (so the same escape sequence support). Floating panes are created with the "new-pane" command, bound to * by default. Currently floating panes can only be moved and resized using the mouse. The default second status line (if "status-format" is set to 2) has changed to show a list of panes. This is the first step and many obvious features are not yet complete (notably the ability to swap floating panes, resize them using resize-pane, change them between floating and tiles, and restore custom layouts with floating panes). Mostly written by Michael Grant with help from Dane Jensen. --- usr.bin/tmux/cmd-split-window.c | 4 ++-- usr.bin/tmux/key-bindings.c | 3 ++- usr.bin/tmux/tmux.1 | 6 ++++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/usr.bin/tmux/cmd-split-window.c b/usr.bin/tmux/cmd-split-window.c index dc00551f3eb..bb338339582 100644 --- a/usr.bin/tmux/cmd-split-window.c +++ b/usr.bin/tmux/cmd-split-window.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-split-window.c,v 1.123 2026/06/06 17:30:48 nicm Exp $ */ +/* $OpenBSD: cmd-split-window.c,v 1.124 2026/06/07 08:25:59 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott @@ -91,7 +91,7 @@ cmd_split_window_exec(struct cmd *self, struct cmdq_item *item) u_int count = args_count(args); if (cmd_get_entry(self) == &cmd_new_pane_entry) - is_floating = 0; /* !args_has(args, 'L'); */ + is_floating = !args_has(args, 'L'); else is_floating = 0; input = (args_has(args, 'I') && count == 0); diff --git a/usr.bin/tmux/key-bindings.c b/usr.bin/tmux/key-bindings.c index a631290c8b8..4b8d41e7c21 100644 --- a/usr.bin/tmux/key-bindings.c +++ b/usr.bin/tmux/key-bindings.c @@ -1,4 +1,4 @@ -/* $OpenBSD: key-bindings.c,v 1.170 2026/05/28 10:34:38 nicm Exp $ */ +/* $OpenBSD: key-bindings.c,v 1.171 2026/06/07 08:25:59 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -362,6 +362,7 @@ key_bindings_init(void) "bind -N 'Split window horizontally' % { split-window -h }", "bind -N 'Kill current window' & { confirm-before -p\"kill-window #W? (y/n)\" kill-window }", "bind -N 'Prompt for window index to select' \"'\" { command-prompt -T window-target -pindex { select-window -t ':%%' } }", + "bind -N 'New floating pane' * { new-pane }", "bind -N 'Switch to previous client' ( { switch-client -p }", "bind -N 'Switch to next client' ) { switch-client -n }", "bind -N 'Rename current window' , { command-prompt -I'#W' { rename-window -- '%%' } }", diff --git a/usr.bin/tmux/tmux.1 b/usr.bin/tmux/tmux.1 index 0d805f3824c..757ecdcbde6 100644 --- a/usr.bin/tmux/tmux.1 +++ b/usr.bin/tmux/tmux.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: tmux.1,v 1.1063 2026/06/05 08:04:03 nicm Exp $ +.\" $OpenBSD: tmux.1,v 1.1064 2026/06/07 08:25:59 nicm Exp $ .\" .\" Copyright (c) 2007 Nicholas Marriott .\" @@ -14,7 +14,7 @@ .\" IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING .\" OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: June 5 2026 $ +.Dd $Mdocdate: June 7 2026 $ .Dt TMUX 1 .Os .Sh NAME @@ -296,6 +296,8 @@ Prompt for a window index to select. Switch the attached client to the previous session. .It \&) Switch the attached client to the next session. +.It * +Create a new floating pane. .It , Rename the current window. .It \-