From c9e22ab67bd7fe89ebb767215f2e671e72573e00 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. --- cmd-split-window.c | 2 +- key-bindings.c | 1 + tmux.1 | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd-split-window.c b/cmd-split-window.c index 59239ee8..56616591 100644 --- a/cmd-split-window.c +++ b/cmd-split-window.c @@ -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/key-bindings.c b/key-bindings.c index 4e145a79..8b97c5f0 100644 --- a/key-bindings.c +++ b/key-bindings.c @@ -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/tmux.1 b/tmux.1 index 223580a1..c23930ce 100644 --- a/tmux.1 +++ b/tmux.1 @@ -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 \-