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
..
2022-06-16 18:43:28 +02:00
2022-06-02 17:25:59 -07:00
2021-04-17 16:43:27 -07:00
2023-11-15 17:58:42 +01:00
2020-11-22 14:39:48 +01:00
2022-06-16 18:43:28 +02:00
2024-01-07 15:13:34 +01:00
2020-06-24 20:43:56 +02:00
2024-01-07 15:13:34 +01:00
2020-11-22 14:39:48 +01:00
2020-11-22 14:39:48 +01:00
2023-06-01 18:20:19 +02:00
2022-06-16 18:43:28 +02:00
2023-06-01 18:20:19 +02:00
2023-06-01 18:20:19 +02:00
2022-06-16 18:43:28 +02:00
2021-01-07 23:53:31 +01:00
2023-06-01 18:20:19 +02:00