mirror of
https://github.com/tmux/tmux.git
synced 2026-09-14 09:11:59 +00:00
Do not allow 0x0 panes and remove a dead member.
This commit is contained in:
@@ -452,7 +452,8 @@ cmd_display_popup_exec(struct cmd *self, struct cmdq_item *item)
|
||||
sx = w->sx;
|
||||
if (sy > w->sy)
|
||||
sy = w->sy;
|
||||
if (lines != PANE_LINES_NONE && (sx < 3 || sy < 3))
|
||||
if ((lines == PANE_LINES_NONE && (sx < 1 || sy < 1)) ||
|
||||
(lines != PANE_LINES_NONE && (sx < 3 || sy < 3)))
|
||||
goto out;
|
||||
if (!cmd_display_menu_get_menu_pos(tc, item, args, &px, &py, sx, sy))
|
||||
goto out;
|
||||
@@ -546,9 +547,6 @@ cmd_display_popup_exec(struct cmd *self, struct cmdq_item *item)
|
||||
events_fire("pane-title-changed", ep);
|
||||
}
|
||||
|
||||
cmd_find_from_winlink_pane(&fs, wl, new_wp, 0);
|
||||
cmdq_insert_hook(s, item, &fs, "after-split-window");
|
||||
|
||||
new_wp->wait_item = item;
|
||||
server_redraw_session(s);
|
||||
if (sc.argv != NULL)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Popups require a tty overlay and cannot be displayed by a control client.
|
||||
# Popups require an attached terminal and cannot be displayed by a control
|
||||
# client.
|
||||
# A popup command from control mode must be ignored cleanly, leaving the
|
||||
# client command queue and server usable.
|
||||
|
||||
|
||||
@@ -375,6 +375,25 @@ esac
|
||||
check_ok kill-pane -t "$modal"
|
||||
sleep 1
|
||||
|
||||
# Creating a popup pane must not fire the split-window hook.
|
||||
check_ok set-hook -t modal after-split-window \
|
||||
"set-option -g @popup-after-split yes"
|
||||
check_ok set-option -g @popup-after-split no
|
||||
check_ok display-popup -E -t "$p0" true
|
||||
must_equal "$($TMUX show-option -gv @popup-after-split)" no
|
||||
check_ok set-hook -u -t modal after-split-window
|
||||
|
||||
# A borderless popup must not create a zero-sized pane in a tiny window.
|
||||
check_ok new-window -d -t modal: -n popup-small 'cat'
|
||||
check_ok set-option -w -t modal:popup-small window-size manual
|
||||
check_ok resize-window -t modal:popup-small -x 1 -y 1
|
||||
small=$(fmt modal:popup-small '#{pane_id}')
|
||||
check_ok bind Z display-popup -B -t "$small" 'cat'
|
||||
$TMUX2 send-keys -t "$OUTER" C-b Z
|
||||
sleep 1
|
||||
must_equal "$(fmt modal:popup-small '#{window_panes}')" 1
|
||||
must_equal "$(fmt modal:popup-small '#{window_modal_pane}')" ''
|
||||
|
||||
$TMUX bind D display-popup -t "$p0" -w 20 -h 5 'printf done'
|
||||
$TMUX2 send-keys -t "$OUTER" C-b D
|
||||
sleep 2
|
||||
|
||||
1
tmux.h
1
tmux.h
@@ -1795,7 +1795,6 @@ struct tty {
|
||||
size_t discarded;
|
||||
|
||||
struct termios tio;
|
||||
struct visible_ranges r;
|
||||
|
||||
struct grid_cell cell;
|
||||
struct grid_cell last_cell;
|
||||
|
||||
Reference in New Issue
Block a user