mirror of
https://github.com/tmux/tmux.git
synced 2026-09-14 09:11:59 +00:00
Act on previous cmd output when cursor on prompt at end of copy-buffer.
This commit is contained in:
@@ -99,6 +99,13 @@ sleep 1
|
||||
$TMUX copy-output -t :empty || exit 1
|
||||
[ "$($TMUX show-buffer)" = one ] || exit 1
|
||||
|
||||
$TMUX new-window -d -n prompt "printf '\\033]133;A\\007p\\$ \\033]133;B\\007echo\\033]133;C\\007one\\n\\033]133;D;0\\007\\033]133;A\\007p\\$ \\033]133;B\\007'; exec sleep 100" || exit 1
|
||||
sleep 1
|
||||
$TMUX copy-mode -U -t :prompt || exit 1
|
||||
$TMUX send-keys -t :prompt.0 -X copy-output || exit 1
|
||||
[ "$($TMUX show-buffer)" = one ] || exit 1
|
||||
$TMUX send-keys -t :prompt.0 -X cancel || exit 1
|
||||
|
||||
$TMUX copy-mode -t :plain || exit 1
|
||||
$TMUX send-keys -t :plain.0 -X copy-output -a || exit 1
|
||||
all=$($TMUX show-buffer)
|
||||
|
||||
@@ -4182,8 +4182,13 @@ window_copy_find_output_range(struct window_mode_entry *wme, u_int *sx,
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!found_start)
|
||||
if (!found_start) {
|
||||
/* At the live prompt, use the most recent command output. */
|
||||
if (cursor_y == screen_hsize(data->source) + data->source->cy)
|
||||
return (window_copy_find_previous_output_range(data->source,
|
||||
sx, sy, ex, ey));
|
||||
return (0);
|
||||
}
|
||||
if (!found_end) {
|
||||
if (y != total)
|
||||
return (0);
|
||||
|
||||
Reference in New Issue
Block a user