fish-shell/doc_src/cmds
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
..
_.rst docs synopsis: add HTML highlighing and automate manpage markup 2022-01-19 22:56:41 +08:00
abbr.rst docs/abbr: Add --command to add subcommand synopsis 2024-04-28 11:33:27 +02:00
alias.rst Minor doc fixes 2024-09-18 22:11:14 +02:00
and.rst docs: Use :doc: role when linking to commands 2022-09-24 10:56:43 +02:00
argparse.rst docs/argparse: Explain dashes in flag names 2024-09-15 09:39:09 +02:00
begin.rst docs: omnibus cleanup 2022-03-12 00:21:13 +08:00
bg.rst docs: Improve bg docs 2023-06-05 18:26:13 +02:00
bind.rst ctrl-l to scroll content instead of erasing screen 2024-12-30 10:50:38 +01:00
block.rst Clarify block command documentation 2024-04-23 19:36:11 +02:00
break.rst docs: Use :doc: role when linking to commands 2022-09-24 10:56:43 +02:00
breakpoint.rst docs synopsis: add HTML highlighing and automate manpage markup 2022-01-19 22:56:41 +08:00
builtin.rst docs: Document type/builtin exit status 2022-09-30 18:50:14 +02:00
case.rst docs synopsis: add HTML highlighing and automate manpage markup 2022-01-19 22:56:41 +08:00
cd.rst Reference more non-fish shell builtins that have relevant differences 2024-04-20 13:34:08 +02:00
cdh.rst docs: use canonical key names in :kbd: tags 2024-04-20 15:36:29 +02:00
command.rst Reference more non-fish shell builtins that have relevant differences 2024-04-20 13:34:08 +02:00
commandline.rst edit_command_buffer: speed up setting cursor position by line/column 2024-11-01 20:09:55 +01:00
complete.rst docs/complete: Explain -r a bit better 2024-09-15 09:44:09 +02:00
contains.rst docs: omnibus cleanup 2022-03-12 00:21:13 +08:00
continue.rst docs: Use :doc: role when linking to commands 2022-09-24 10:56:43 +02:00
count.rst docs synopsis: make all placeholder arguments uppercase 2022-01-19 22:56:41 +08:00
dirh.rst docs: Use :doc: role when linking to commands 2022-09-24 10:56:43 +02:00
dirs.rst docs: Use :doc: role when linking to commands 2022-09-24 10:56:43 +02:00
disown.rst docs: Clarify that disowned jobs won't fire on-process/job-exit 2024-03-19 16:39:37 +01:00
echo.rst Reference more non-fish shell builtins that have relevant differences 2024-04-20 13:34:08 +02:00
else.rst docs: Use :doc: role when linking to commands 2022-09-24 10:56:43 +02:00
emit.rst docs: omnibus cleanup 2022-03-12 00:21:13 +08:00
end.rst docs: Use :doc: role when linking to commands 2022-09-24 10:56:43 +02:00
eval.rst docs: Use :doc: role when linking to commands 2022-09-24 10:56:43 +02:00
exec.rst Reference more non-fish shell builtins that have relevant differences 2024-04-20 13:34:08 +02:00
exit.rst docs: Use :doc: role when linking to commands 2022-09-24 10:56:43 +02:00
export.rst docs/export: Add a bit on PATH=$PATH:... 2024-11-06 18:50:41 +01:00
false.rst docs: Use :doc: role when linking to commands 2022-09-24 10:56:43 +02:00
fg.rst docs: Use :doc: role when linking to commands 2022-09-24 10:56:43 +02:00
fish.rst Allow installable builds to be installed into a specific path (#10923) 2024-12-22 18:16:07 +01:00
fish_add_path.rst fish_add_path: Automatically enable verbose mode for interactive use 2024-06-06 16:47:39 +02:00
fish_breakpoint_prompt.rst docs: Use :doc: role when linking to commands 2022-09-24 10:56:43 +02:00
fish_clipboard_copy.rst docs: use canonical key names in :kbd: tags 2024-04-20 15:36:29 +02:00
fish_clipboard_paste.rst docs: use canonical key names in :kbd: tags 2024-04-20 15:36:29 +02:00
fish_command_not_found.rst docs synopsis: add HTML highlighing and automate manpage markup 2022-01-19 22:56:41 +08:00
fish_config.rst docs: Turn off highlighting correctly in fish_config 2023-06-16 16:17:58 +02:00
fish_default_key_bindings.rst Correct fish_default_key_bindings docs 2024-06-15 12:18:37 -07:00
fish_delta.rst Add a fish_delta helper function 2022-10-19 20:06:35 +02:00
fish_git_prompt.rst git prompt: Interpret values of "1", "yes" or "true" as true for bools instead of relying on defined-or-not (#9274) 2022-10-21 20:22:20 +02:00
fish_greeting.rst docs: fix double space in example fish_greeting 2024-01-06 15:26:20 +01:00
fish_hg_prompt.rst docs: Use :doc: role when linking to commands 2022-09-24 10:56:43 +02:00
fish_indent.rst Teach fish_indent to only indent and unindent 2024-04-15 08:32:31 +02:00
fish_is_root_user.rst docs synopsis: add HTML highlighing and automate manpage markup 2022-01-19 22:56:41 +08:00
fish_key_reader.rst Add back docs for fish_key_reader --verbose 2024-08-11 14:57:04 +02:00
fish_mode_prompt.rst docs: standardise name for vi mode 2023-12-17 17:40:45 +08:00
fish_opt.rst Fix small typos 2023-11-18 18:27:25 -08:00
fish_prompt.rst docs synopsis: add HTML highlighing and automate manpage markup 2022-01-19 22:56:41 +08:00
fish_right_prompt.rst We no longer have two doc systems, move sphinx_doc_src back to doc_src 2020-02-19 17:00:35 -08:00
fish_should_add_to_history.rst docs: Add fish_should_add_to_history to commands list 2024-03-09 12:09:00 +01:00
fish_status_to_signal.rst docs synopsis: add HTML highlighing and automate manpage markup 2022-01-19 22:56:41 +08:00
fish_svn_prompt.rst docs: Use :doc: role when linking to commands 2022-09-24 10:56:43 +02:00
fish_title.rst docs synopsis: add HTML highlighing and automate manpage markup 2022-01-19 22:56:41 +08:00
fish_update_completions.rst docs synopsis: add HTML highlighing and automate manpage markup 2022-01-19 22:56:41 +08:00
fish_vcs_prompt.rst docs: Use :doc: role when linking to commands 2022-09-24 10:56:43 +02:00
fish_vi_key_bindings.rst docs: standardise name for vi mode 2023-12-17 17:40:45 +08:00
for.rst docs: Use :doc: role when linking to commands 2022-09-24 10:56:43 +02:00
funced.rst docs: Point to functions/type from funced/funcsave 2024-08-13 17:44:23 +02:00
funcsave.rst docs: Point to functions/type from funced/funcsave 2024-08-13 17:44:23 +02:00
function.rst Explain function --argument-names in more detail. (#10524) 2024-06-19 22:51:47 -05:00
functions.rst functions --copy: store file and lineno (#9542) 2023-02-13 09:59:28 -06:00
help.rst docs: More about envvars 2023-01-09 20:33:37 +01:00
history.rst add history append subcommand 2024-04-15 08:31:16 +02:00
if.rst docs/if: Link to other builtins 2023-02-28 20:49:11 +01:00
isatty.rst Fix formatting for isatty 2022-10-19 20:10:26 +02:00
jobs.rst Reference more non-fish shell builtins that have relevant differences 2024-04-20 13:34:08 +02:00
math.rst feat(math): add round options (#9117) 2024-06-23 17:45:52 -05:00
nextd.rst docs: Use :doc: role when linking to commands 2022-09-24 10:56:43 +02:00
not.rst Document the ! (not) and . (source) aliases more 2024-04-20 13:34:08 +02:00
open.rst docs synopsis: add HTML highlighing and automate manpage markup 2022-01-19 22:56:41 +08:00
or.rst docs: Use :doc: role when linking to commands 2022-09-24 10:56:43 +02:00
path.rst fix documentation for path normalize 2024-10-27 08:32:05 +00:00
popd.rst docs: Use :doc: role when linking to commands 2022-09-24 10:56:43 +02:00
prevd.rst docs: Use :doc: role when linking to commands 2022-09-24 10:56:43 +02:00
printf.rst Reference more non-fish shell builtins that have relevant differences 2024-04-20 13:34:08 +02:00
prompt_hostname.rst docs synopsis: add HTML highlighing and automate manpage markup 2022-01-19 22:56:41 +08:00
prompt_login.rst docs: omnibus cleanup 2022-03-12 00:21:13 +08:00
prompt_pwd.rst docs/prompt_pwd: Fix envvar linking 2022-12-30 14:31:32 +01:00
psub.rst docs: omnibus cleanup 2022-03-12 00:21:13 +08:00
pushd.rst docs: Use :doc: role when linking to commands 2022-09-24 10:56:43 +02:00
pwd.rst Reference more non-fish shell builtins that have relevant differences 2024-04-20 13:34:08 +02:00
random.rst docs: omnibus cleanup 2022-03-12 00:21:13 +08:00
read.rst docs: Fix some formatting 2024-05-27 23:21:06 +02:00
realpath.rst Reference more non-fish shell builtins that have relevant differences 2024-04-20 13:34:08 +02:00
return.rst docs: Use :doc: role when linking to commands 2022-09-24 10:56:43 +02:00
set.rst docs: Update synopsis for 'set' 2024-09-14 10:29:44 +02:00
set_color.rst docs: Fix markdown links 2023-11-22 18:42:34 +01:00
source.rst Document the ! (not) and . (source) aliases more 2024-04-20 13:34:08 +02:00
status.rst Add status buildinfo (#10896) 2024-12-29 13:37:28 +01:00
string-collect.rst Fix more lost string documentation 2022-05-14 10:05:02 +02:00
string-escape.rst Improve documentation for string escape 2024-12-29 13:48:34 -08:00
string-join.rst New -n flag for string join. (#8774) 2022-03-13 11:47:33 +01:00
string-join0.rst We no longer have two doc systems, move sphinx_doc_src back to doc_src 2020-02-19 17:00:35 -08:00
string-length.rst string docs: format options and arguments in line with other pages 2022-03-12 22:22:02 +08:00
string-lower.rst string docs: format options and arguments in line with other pages 2022-03-12 22:22:02 +08:00
string-match.rst Fix short/long delimiter in string {match,replace} 2024-07-06 16:18:14 +02:00
string-pad.rst docs/string: Separate "pad" and "shorten" 2023-04-20 22:17:08 +02:00
string-repeat.rst Add documentation and release notes for #10282 2024-02-11 12:43:13 +01:00
string-replace.rst string-replace.rst: fix trailing whitespace 2024-07-23 11:47:58 +02:00
string-shorten.rst docs/string: Separate "pad" and "shorten" 2023-04-20 22:17:08 +02:00
string-split.rst docs: Use :doc: role when linking to commands 2022-09-24 10:56:43 +02:00
string-split0.rst We no longer have two doc systems, move sphinx_doc_src back to doc_src 2020-02-19 17:00:35 -08:00
string-sub.rst Fix more lost string documentation 2022-05-14 10:05:02 +02:00
string-trim.rst docs/string-trim: Double down on the set of chars vs string thing 2024-11-25 17:53:14 +01:00
string-unescape.rst We no longer have two doc systems, move sphinx_doc_src back to doc_src 2020-02-19 17:00:35 -08:00
string-upper.rst string docs: format options and arguments in line with other pages 2022-03-12 22:22:02 +08:00
string.rst Add documentation and release notes for #10282 2024-02-11 12:43:13 +01:00
suspend.rst docs: omnibus cleanup 2022-03-12 00:21:13 +08:00
switch.rst docs: More about envvars 2023-01-09 20:33:37 +01:00
test.rst Deprecate builtin test's one- and zero-argument modes (#10365) 2024-04-21 14:25:54 +02:00
time.rst Reference more non-fish shell builtins that have relevant differences 2024-04-20 13:34:08 +02:00
trap.rst Reference more non-fish shell builtins that have relevant differences 2024-04-20 13:34:08 +02:00
true.rst docs: Use :doc: role when linking to commands 2022-09-24 10:56:43 +02:00
type.rst Reference more non-fish shell builtins that have relevant differences 2024-04-20 13:34:08 +02:00
ulimit.rst docs: Fix typos 2022-09-17 21:31:06 +08:00
umask.rst Reference more non-fish shell builtins that have relevant differences 2024-04-20 13:34:08 +02:00
vared.rst docs: omnibus cleanup 2022-03-12 00:21:13 +08:00
wait.rst Minor doc fixes 2024-09-18 22:11:14 +02:00
while.rst docs: Use :doc: role when linking to commands 2022-09-24 10:56:43 +02:00