Skip to content
This repository has been archived by the owner on Mar 2, 2025. It is now read-only.

[cli] Change unconventional behavior of Ctrl-C #369

Closed
triallax opened this issue Mar 19, 2023 · 2 comments · Fixed by #375
Closed

[cli] Change unconventional behavior of Ctrl-C #369

triallax opened this issue Mar 19, 2023 · 2 comments · Fixed by #375
Labels
Milestone

Comments

@triallax
Copy link
Contributor

In most REPL-style tools I use, Ctrl-D is the binding used to exit the program, while Ctrl-C "resets" the prompt. There is some variety with Ctrl-C's behavior if the current input is empty (on the shells that I tried, it just starts a new prompt, but with e.g. Qalculate it exits the program), yet with everything I tried, Ctrl-C starts a new, empty line if there is existing input. Insect is the only program I am aware of that flies in the face of this convention and always exits when Ctrl-C is pressed, and I think keeping it like this is a mistake.

A question arises if we decide to do this, however: when there is no input, should Ctrl-C exit Insect (like Qalculate does), or should it simply start a new line (like basically all of the shells I tried)?

Thoughts?

@triallax triallax added the cli label Mar 19, 2023
@triallax triallax changed the title [terminal version] Ctrl-C should "reset" input, not terminate insect [cli] Ctrl-C should "reset" input, not terminate insect Mar 19, 2023
@triallax triallax changed the title [cli] Ctrl-C should "reset" input, not terminate insect [cli] Change unconventional behavior of Ctrl-C Mar 19, 2023
@sharkdp
Copy link
Owner

sharkdp commented Mar 25, 2023

always exits when Ctrl-C is pressed, and I think keeping it like this is a mistake.

I wonder if it has always been like this, or if it was caused by the readline dependency switch. Anyway, I fully agree that this should be changed.

A question arises if we decide to do this, however: when there is no input, should Ctrl-C exit Insect (like Qalculate does), or should it simply start a new line (like basically all of the shells I tried)?

Let's go with "all the other shells"

@triallax
Copy link
Contributor Author

I wonder if it has always been like this, or if it was caused by the readline dependency switch.

I'm highly leaning towards it being the earlier case, but I don't necessarily feel like checking.

Let's go with "all the other shells"

Alright then, I slightly prefer this option too.

@triallax triallax assigned triallax and unassigned triallax Mar 25, 2023
@triallax triallax added this to the v5.9.0 milestone Mar 25, 2023
triallax added a commit to triallax/insect that referenced this issue Mar 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants