5 ms·
> Another common extension is to use what is sometimes called a double Ctrl-C pattern. The first time the user hits Ctrl-C, you attempt to shut down the databas
by layer8 2y ago
> Another common extension is to use what is sometimes called a double Ctrl-C pattern. The first time the user hits Ctrl-C, you attempt to shut down the database cleanly, but the second time you encounter it, you give up and exit immediately.
This is a terrible behavior, because users tend to hit Ctrl-C multiple times without intending anything different than on a single hit (not to mention bouncing key mechanics and short key repeat delays). Unclean exits should be reserved for SIGQUIT (Ctrl-\) and SIGKILL (by definition).
- bcrl 2y agoThat shouldn't matter. Your database should be consistent in the face of an unclean exit. ACID has been around for a long time.
- tripdout 2y agoIf you don't know about it, sure, but I find it's kind of convenient to get a safe shutdown and then be able to easily say "I don't care, just stop this program" without needing a separate kill -9 command or something.
- layer8 2y agoAs I wrote, Ctrl-\ should do the trick. And it’s just not practical having to know which program applies the double pattern, and having to train yourself to not accidentally hit Ctrl-C twice.
- __MatrixMan__ 2y agoMy brush with the double-ctrl-C pattern was in a place that wrote a lot of Java. It was generally frowned on to write any code that relied on signals which windows users can't send, and if I recall, Java made it quite difficult anyhow. Windows does have a tradition of using ctrl-c to quit though, so SIGINT ends up being one of the few that you can use in both places. It's not pretty, but giving it a different meaning based on how many times you've ordered it seems like a somewhat natural next step, if a hacky one.
- wombatpm 2y agoKids these day. Try resetting server windows on a sgi. Subject: -42- How can I restart the X server? Date: 10 Sep 1995 00:00:01 EST To restart the X server (Xsgi) once, do any one of the following (in increasing order of brutality): - killall -TERM Xsgi - hold down the left-Control, left-Shift, F12 and keypad slash keys (this is fondly known as the "Vulcan Death Grip") - /usr/gfx/stopgfx; /usr/gfx/startgfx - reboot To restart the X server every time someone logs out of the console, edit /var/X11/xdm/xdm-config, change the setting of "DisplayManager._0.terminateServer" from "False" to "True" and do 'killall -HUP xdm'.
- deleted 2y ago[deleted]
- jcelerier 2y 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.
- Sophira 2y agoWhile 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).
- mananaysiempre 2y agostty quit ^] ?
- Izkata 2y ago> 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.
- Am4TIfIsER0ppos 2y agoWhen using a keyboard "properly" how are you gonna manage that?
- LtWorf 2y agotwo handed operations shouldn't exist.
- Sophira 2y agoI completely agree - they're very inaccessible. That's why I quoted the word "problem"; it's not actually a problem at all.
- bonzini 2y agoIn the Meson build system's test harness, a single Ctrl-C terminates the longest running test with a SIGTERM; while three Ctrl-C in a second interrupt the whole run as if you sent the harness a SIGTERM. This was done because it's not uncommon that there are hundreds of tests left to run and you have seen what you want, and it's useful to have an intuitive shortcut for that case. However, in both cases it's a clean shutdown, all running are terminated and the test report is printed.
- marcosdumay 2y agoIt's worse, because there are languages that encode interruption into the error handling functionality, so it's common that people mismanage their errors and programs require several Ctrl-C presses to actually reach the interruption handler. What means that you have to memorize a list of "oh, this program needs Ctrl-C 3 times; oh, this program must only receive Ctrl-C once!"... I don't know of any "oh, this program needs Ctrl-C exactly 2 times", but it's an annoying possibility.
- wongarsu 2y agoAny software I've come across that uses intentional double ctrl-c shows a message after the first ctrl-c. Something to the effect of "shutting down gracefully, press ctrl-c again for immediate shutdown". Hence you can just press it once and wait half a second, if no message to this effect appears you can spam ctrl-c.
- sunshowers 2y agoYep, this is generally the pattern.
- Levitating 2y agoThey can print a message that states that it is attempting to quit cleanly but can be forced to quit by pressing Ctrl+C another time(s). Unison does this.
- sunshowers 2y agoWhile I agree in spirit, I also want to meet users where they are.