Hacker Newsnew | past | comments | ask | show | jobs | submit | Pete_D's commentslogin

The terminal can optionally catch some characters and convert them to signals. By default, ^C sends SIGINT, ^\ sends SIGQUIT, and ^Z sends SIGTSTP. Programs can disable that for their own purposes (stty -isig) and you can rebind them to other characters if you want (stty intr, stty quit, stty susp) but I don't know why anyone would these days.


In Linux and UNIX you enable or disable use of ctrl+c (effectively setting the tty into a raw mode) via syscalls against the tty file descriptor - it is not handled by the terminal emulator at all (in fact if you read the man page for `stty` you'd see it's changing the your terminals fd and not the terminal emulator).

Sure, theoretically terminal emulators could capture and even rebind those keys via the APIs of whatever graphical toolkit they're built in....but if you wanted to rebind SIGINT to another key in the terminal emulator, that terminal emulator would still have to transmit ^c to the tty.

As for rebinding those keys in the kernel, Linux simply doesn't support doing that and nor does it support binding other keys to different signals. In fact I've tried to do this on a tool I was working on to emulate BSD's SIGINFO in Linux (turned out not to be possible) as as well part of the job control (SIGSTSP et al) support in my $SHELL (https://github.com/lmorg/murex).

This is also why you can throw signals over an SSH (or other remote shell) session when the terminal emulator itself would have no knowledge of the commands running on the remote host.


Good point, I should have said TTY driver (all my information is from half-remembered reading of https://www.linusakesson.net/programming/tty/index.php, any mistakes are my own).

With respect to rebinding, what is "stty intr ^D" doing if not rebinding the interrupt character to ^D?

I feel your pain about not having SIGINFO though.


Amiga icons really felt like they were miles ahead of the competition and I'm surprised more of their possibilities didn't take off in other OSes.

- could change the icon for individual files/folders

- could have differently-sized icons

- different icons for unclicked + clicked state


Genuine question from someone looking at toying with graphics programming who had never heard of WebGPU before today: does this mean I should hold off on learning WebGL? How different are the two?


If you don't have any kind of experience, you are better off starting with WebGL.

It is more beginner friendly and it is here now.

You can either start from scratch:

https://webglfundamentals.org/

Or use one of the two most developer friendly frameworks.

https://threejs.org/

https://www.babylonjs.com/

If you have zero experience in graphics, another approach is to learn about 3D software rendering in first place.

https://www.davrous.com/2013/06/13/tutorial-series-learning-...

Leave WebGPU for when you feel comfortable with 3D programming.


Thanks! I'd actually been looking for that software rendering article for a while as well and couldn't find it.


I didn't appreciate how big of a deal washing machines were until mine broke down and I had to do all my laundry in the bathtub for a couple of weeks waiting for a replacement. Hand-washing is a lot more of a workout than you'd expect, and getting things dry without a spin-cycle afterwards is a pain too.


The problem is that this allows a neat loophole in which governments can sidestep any inconvenient civil rights obligations by privatisation of otherwise public space. For a real-life example, see https://en.wikipedia.org/wiki/Paternoster_Square#Occupy_Lond....


There are lots of fun ways to smooth out short-term variation in game randomness. This article shows a few used by various Tetris games, with one of them being your deck-of-cards approach: https://simon.lc/the-history-of-tetris-randomizers

One of my favourite techniques not listed there is weighting the probabilities by distance, so individual outcomes get more likely the longer you've not seen them (making the gamblers' fallacy real, I guess).


Depression has quite a few weird effects on memory, e.g. https://en.wikipedia.org/wiki/Overgeneral_Autobiographical_M...


Off topic, but in today's bitter and divided world, it's reassuringly wholesome that people can still get together to recite the alphabet in GitHub comments.


> cold showers can be dangerous for people with per-existing heart conditions

I think cold showers trigger the diving reflex[0] ("most noticeable effects are on the cardiovascular system, which displays ... in humans, heart rhythm irregularities"). I don't have a real source for that, but I tried cold showers a few times and found it impossible to breathe when I had cold water spraying on my face, like I could feel my airway closing involuntarily. Warm/hot water doesn't do that.

[0] https://en.wikipedia.org/wiki/Diving_reflex


> Shrooms seem to be the next wave of legalization an in some ways it seems like it is already partly legal.

Weirdly, fresh shrooms were legal in the UK right up to 2005, when they were put in the same category as heroin and cocaine. I remember walking past shops openly advertising them. (Peyote cactuses too, which according to Wikipedia are still legal.)


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: