Hacker News new | ask | show | jobs
by jcelerier 648 days ago
> Unclean exits should be reserved for SIGQUIT (Ctrl-\) and SIGKILL (by definition).

I don't know how it works on your keyboard but on french layout, Ctrl-\ is a two-hands, three-fingers, very unpleasant on the wrist, keyboard shortcut. Not a chance I'd use that for such a common operation.

3 comments

The byte that sends SIGQUIT is very much configurable with stty quit ^X , but unfortunately X has to be a-z or one of \]^_ (that is, 0x41 through 0x5F except 0x5B = [ which would conflict with other uses of ESC = ^[ = 0x1B) because of how the Ctrl modifier traditionally works. Looking at a map of AZERTY, I don’t see any good options, but you may still want to experiment.
Curiously, on many terminal emulators the following work:

Ctrl-2 = Ctrl-@ = NUL byte

Ctrl-3 = Ctrl-[ = ESC

Ctrl-4 = Ctrl-\ = default for SIGQUIT

Ctrl-5 = Ctrl-] = jump to definition in vim

Ctrl-6 = Ctrl-^ = mosh escape key

Ctrl-7 = Ctrl-_ = undo in Emacs

I think these probably originate in xterm.

I map SIGQUIT to ^Q because that's the easiest to remember.
I suppose you never hit CTRL+S by accident?
stty -ixon

Make sure that thing is disabled

I like that Konlose defaults into disabling that thing. And also that there is a visual sign of the terminal being stopped.
Ctrl-S / Ctrl-Q was super useful in the dialup modem days.
Rarely enough that needing to open another terminal and use kill to send a signal doesn't bother me.
I think the point is that it is not to be a common operation.
well I don't know, it feels like I must mash ctrl-c twenty times per day on average at least
While on UK keyboards it's the opposite "problem" - the left Ctrl key and the \ key are right next to each other (making it potentially a one-finger operation), which is the opposite of how a US keyboard is laid out (where Ctrl-\ was presumably intended to need to be a two-handed, two-finger operation).
> which is the opposite of how a US keyboard is laid out (where Ctrl-\ was presumably intended to need to be a two-handed, two-finger operation).

We have a right Ctrl, so one-hand two-finger.

When using a keyboard "properly" how are you gonna manage that?
two handed operations shouldn't exist.
I completely agree - they're very inaccessible. That's why I quoted the word "problem"; it's not actually a problem at all.
stty quit ^] ?