fish-shell/tests/pexpects
Johannes Altmanninger 83b0294fc9 ctrl-l to scroll content instead of erasing screen
On ctrl-l we send `\e[2J` (Erase in Display).  Some terminals interpret
this to scroll the screen content instead of clearing it. This happens
on VTE-based terminals like gnome-terminal for example.

The traditional behavior of ctrl-l erasing the screen (but not the
rest of the scrollback) is weird because:

1. `ctrl-l` is the easiest and most portable way to push the prompt
   to the top (and repaint after glitches I guess). But it's also a
   destructive action, truncating scrollback. I use it for scrolling
   and am frequently surprised when my scroll back is missing
   information.
2. the amount of lines erased depends on the window size.
   It would be more intuitive to erase by prompts, or erase the text
   in the terminal selection.

Let's use scrolling behavior on all terminals.

The new command could also be named "push-to-scrollback", for
consistency with others. But if we anticipate a want to add other
scrollback-related commands, "scrollback-push" is better.

This causes tests/checks/tmux-history-search.fish to fail; that test
seems pretty broken; M-d (alt-d) is supposed to delete the current
search match but there is a rogue "echo" that is supposed to invalidate
the search match.  I'm not sure how that ever worked.

Also, pexepect doesn't seem to support cursor position reporting,
so work around that.

Ref: https://codeberg.org/dnkl/foot/wiki#how-do-i-make-ctrl-l-scroll-the-content-instead-of-erasing-it
as of wiki commit b57489e298f95d037fdf34da00ea60a5e8eafd6d

Closes #10934
2024-12-30 10:50:38 +01:00
..
abbrs.py Remove some unused code from the tests 2024-12-08 13:57:10 -08:00
bind.py ctrl-l to scroll content instead of erasing screen 2024-12-30 10:50:38 +01:00
bind_mode_events.py On undo after execute, restore the cursor position 2024-12-21 13:10:34 +01:00
cancel_event.py Control-C to simply clear commandline buffer again 2024-01-17 19:54:57 +01:00
commandline.py pexpects: Fix some escapes 2024-12-27 20:05:10 +01:00
complete-group-order.py pexpects: Fix some escapes 2024-12-27 20:05:10 +01:00
complete.py On undo after execute, restore the cursor position 2024-12-21 13:10:34 +01:00
cursor_selection.py Restyle fishscript and python 2023-06-01 18:20:19 +02:00
disable_mouse.py Remove some unused code from the tests 2024-12-08 13:57:10 -08:00
eval-stack-overflow.py pexpects: Fix some escapes 2024-12-27 20:05:10 +01:00
exit.py pexpects: Disable exit on CI Darwin/FreeBSD 2024-12-15 17:33:12 +01:00
exit_handlers.py Remove some unused code from the tests 2024-12-08 13:57:10 -08:00
exit_nohang.py Remove some unused code from the tests 2024-12-08 13:57:10 -08:00
fg.py Remove some unused code from the tests 2024-12-08 13:57:10 -08:00
fkr.py Remove some unused code from the tests 2024-12-08 13:57:10 -08:00
generic.py Remove some unused code from the tests 2024-12-08 13:57:10 -08:00
histfile.py Fix the histfile.py test 2024-06-02 15:31:19 -07:00
history.py pexpects: Fix some escapes 2024-12-27 20:05:10 +01:00
isatty.py Remove some unused code from the tests 2024-12-08 13:57:10 -08:00
job_summary.py tests/pexpect: Fix \d escape 2024-04-02 22:41:54 +02:00
nullterm.py Be careful to not touch curses variables if cur_term is null 2022-04-16 13:26:56 -07:00
pipeline.py Improve error for redirections to invalid paths 2021-11-20 17:44:05 +01:00
postexec.py Reformat 2020-11-22 14:39:48 +01:00
private_mode.py Restyle fishscript and python 2023-06-01 18:20:19 +02:00
prompt_redraw_loop.py Fix infinite prompt loop if status message is printed in prompt 2024-12-08 18:12:59 -08:00
read.py On undo after execute, restore the cursor position 2024-12-21 13:10:34 +01:00
set_color.py Remove some unused code from the tests 2024-12-08 13:57:10 -08:00
sigint.py Add missing expect_prompt to test_sigint.py 2024-01-07 00:54:22 +01:00
signals.py One more FreeBSD-only-in-CI 2024-12-15 17:38:37 +01:00
status.py On undo after execute, restore the cursor position 2024-12-21 13:10:34 +01:00
stdin_nonblocking.py Remove some unused code from the tests 2024-12-08 13:57:10 -08:00
terminal.py Disable terminal protocols throughout evaluation 2024-04-02 21:25:47 +02:00
torn_escapes.py pexpects: Disable 2 only on CI 2024-12-15 17:32:47 +01:00
tty_ownership.py Claim the tty unconditionally in reader_data_t::readline 2022-09-09 13:43:29 -07:00
undo.py Fix the undo pexpect 2024-06-02 14:17:36 -07:00
wait.py share/config.fish: Quit if job expansion hack errors 2023-06-10 15:36:36 +02:00
wildcard_tab.py Remove some unused code from the tests 2024-12-08 13:57:10 -08:00