Nushell: Surprising (buggy?) ctrl-c behavior

Created on 26 Aug 2019  路  5Comments  路  Source: nushell/nushell

This sequence of events is surprising (and, I think, buggy) to me:

  1. type ls /tmp/xzy^c
  2. the command exits and I'm brought to a new line, which I expect. I frequently ctrl-c in bash to mean "abandon this command and return me to a blank prompt"
  3. type ls /tmp/xzy^c
  4. nu exits
$ nu
/Users/llimllib> ls /tmp/xzy
CTRL-C pressed (again to quit)
/Users/llimllib> ls /tmp/xzy
<I get returned to my bash prompt>

In this case, I expect to just have told nu twice to abandon the command I was entering, but instead I get dumped from the shell.

Is this expected behavior? ^c^c in bash doesn't exit the shell, and I'm going to have to retrain my hands if I want to use nu without that.

bug

Most helpful comment

Thumbs up for this - I also use Ctrl-c in this situation.
IMHO closing the shell on double Ctrl-c is weird - that's what Ctrl-d is for...

All 5 comments

Thumbs up for this - I also use Ctrl-c in this situation.
IMHO closing the shell on double Ctrl-c is weird - that's what Ctrl-d is for...

I share this view. Additionally, I think there should be no warning at all, for the "double click CTRL+C to exit shell", because this is utterly redundant. Especially since you are supposed to use a shell basically your whole session and not only for a couple minutes (like e. g. a SQL CLI ).
Im not against keeping the double CTRL+C exiting way, but the mentioned bug in this issue should be gone, as well as the warning message, in my opinion.

FWIW, I very frequently press CTRL-C many times in a row, the same way as I press CTRL-S repeatedly in editors or ESC multiple times in Vim. Quitting the shell every time that happens would be annoying, PDB (python debugger) already does quit on CTRL-C and it annoys me every time. I feel like this should be at least allowed to be disabled in favour of the usual CTRL-D on an empty line quitting.

@jonathandturner this seems right to me. What do you think?

Yes, we can definitely make it configurable how ctrl-c works.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

daschl picture daschl  路  5Comments

jonathandturner picture jonathandturner  路  3Comments

KasMA1990 picture KasMA1990  路  4Comments

ChrisDenton picture ChrisDenton  路  4Comments

kvrhdn picture kvrhdn  路  3Comments