fish-shell/tests/pexpects
Johannes Altmanninger fff8e8163b Control-C to simply clear commandline buffer again
Commit 5f849d0 changed control-C to print an inverted ^C and then a newline.

The original motivation was

> In bash if you type something and press ctrl-c then the content of the line
> is preserved and the cursor is moved to a new line. In fish the ctrl-c just
> clears the line. For me the behaviour of bash is a bit better, because it
> allows me to type something then press ctrl-c and I have the typed string
> in the log for further reference.

This sounds like a valid use case in some scenarios but I think that most
abandoned commands are noise. After all, the user erased them. Also, now that
we have undo that can be used to get back a limited set of canceled commands.

I believe the original motivation for existing behavior (in other shells) was
that TERM=dumb does not support erasing characters. Similarly, other shells
like to leave behind other artifacts, for example when using tab-completion
or in their interactive menus but we generally don't.

Control-C is the obvious way to quickly clear a multi-line commandline.
IPython does the same. For the other behavior we have Alt-# although that's
probably not very well-known.

Restore the old Control-C behavior of simply clearing the command line.

Our unused __fish_cancel_commandline still prints the ^C. For folks who
have explicitly bound ^C to that, it's probably better to keep the existing
behavior, so let's leave this one.

Previous attempt at #4713 fizzled.

Closes #10213
2024-01-17 19:54:57 +01:00
..
abbrs.py abbr: stop parsing option after first expansion token 2022-12-13 01:39:31 +01:00
bind.py reader: Fix infinite loop for up/downcase bindings 2024-01-16 18:13:18 +01:00
bind_mode_events.py Restyle codebase 2022-06-16 18:43:28 +02:00
cancel_event.py Control-C to simply clear commandline buffer again 2024-01-17 19:54:57 +01:00
commandline.py tests: Disable one commandline test 2023-04-28 17:41:29 +02:00
complete-group-order.py Restyle fishscript and python 2023-06-01 18:20:19 +02:00
complete.py Add a test for COMPLETE_AUTO_SPACE 2022-06-02 17:25:59 -07:00
cursor_selection.py Restyle fishscript and python 2023-06-01 18:20:19 +02:00
disable_mouse.py Simplify event_queue_peeker_t 2021-04-17 16:43:27 -07:00
eval-stack-overflow.py Restyle fishscript and python 2023-06-01 18:20:19 +02:00
exit.py Reformat 2020-11-22 14:39:48 +01:00
exit_handlers.py Add a test that fish_exit handlers run on receipt of SIGHUP 2020-08-30 15:09:34 -07:00
exit_nohang.py tests: Increase a sleep 2023-11-15 17:58:42 +01:00
fg.py Restyle codebase 2022-06-16 18:43:28 +02:00
fkr.py Restyle 2024-01-07 15:13:34 +01:00
generic.py pexpects: Fix spurious failure in generic.py 2023-08-15 19:14:33 +02:00
histfile.py Another formatting run 2020-06-24 20:43:56 +02:00
history.py Restyle 2024-01-07 15:13:34 +01:00
isatty.py Reformat 2020-11-22 14:39:48 +01:00
job_summary.py tests: Skip job_summary under ASAN in CI 2023-11-19 19:46:05 +01: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
read.py Restyle codebase 2022-06-16 18:43:28 +02:00
set_color.py set_color: Print the given colors with --print-colors 2022-07-01 21:28:35 +02:00
sigint.py Add missing expect_prompt to test_sigint.py 2024-01-07 00:54:22 +01:00
signals.py Restyle fishscript and python 2023-06-01 18:20:19 +02:00
status.py Restyle fishscript and python 2023-06-01 18:20:19 +02:00
stdin_nonblocking.py stdin_nonblocking.py test to not leave background processes 2022-02-12 11:48:55 -08:00
terminal.py Restyle codebase 2022-06-16 18:43:28 +02:00
torn_escapes.py Fix stale references to getch() 2022-09-16 18:26:49 -05:00
tty_ownership.py Claim the tty unconditionally in reader_data_t::readline 2022-09-09 13:43:29 -07:00
undo.py Add simple pexpect test for undo 2021-01-07 23:53:31 +01:00
wait.py share/config.fish: Quit if job expansion hack errors 2023-06-10 15:36:36 +02:00
wildcard_tab.py Restyle fishscript and python 2023-06-01 18:20:19 +02:00