terminology poll: what would you call the part of the operating system that is responsible for managing the pseudoterminal device? (handling ioctls, tracking the foreground process, remembering the terminal window size, turning `Ctrl+C` into a SIGTERM, handling `Ctrl+S` and `Ctrl+W`, etc)

(also open to hearing that you think that it's not just one thing or anything else really)

line discipline
4.7%
terminal driver
51.4%
what?
39.6%
other
4.2%
Poll ended at .

@b0rk

Is it even in the operating system?

My terminal program (kitty most recently) has a config to say things like "when I type ctrl-c - send 'interrupt'" - so clearly it's not just the OS on the machine I am ssh'd into that handles that.

In my "understanding" (which may be entirely wrong, lol) - it's a game of telephone. I hit ctrl-C - and a sequence of entities get to decide what happens. My local keyboard driver might remap that before handing it to kitty, who may or may not pass that thru ssh to the server I am logged into, terminal driver, pty, shells, etc etc. - with any element in the chain having the capacity to pass that along or change it. So - there's no single entity to pin the blame on.

@tbortels ooh do you know what the name of that config parameter is? would love to learn more about that, I'm surprised!
@b0rk @tbortels Probably referring to 'copy_or_interrupt' - if there's selected text, do a copy, if not, send an interrupt.

@gomijacogeo @b0rk

I think that was the original/default setting - and it was breaking vim. And while I am a wily haxxor, I try to avoid vim configs because it never ends well for me.

@tbortels @gomijacogeo ah I see -- yeah I guess the deal is that kitty can make ctrl+c copy to the clipboard if it wants, but it can't map Ctrl+C to something _other_ than interrupt, like for example it can't make `Ctrl+C` send a different signal. only the operating system can do that

(but it would be extremely weird for someone to reconfigure Ctrl+C at the OS level to do something other than "interrupt" so it's fair of kitty to assume that's what it does)

@b0rk @gomijacogeo

So - some of the actions you can map to any key (not just ctrl-C) are "send_key", "send_text" (woo macros!) and "send_signal" to "Send the specified SIGNAL to the foreground process in the active window" - they give SIGTERM as the example.

The OS (or the program in the foreground) could choose to ignore most signals, of course. This is why I picked "other" - I think the responsibility for "what happens when I ctrl-C" is a group consensus thing, with the message getting passed along the chain until someone decides to stop passing it along.

I'm surprised this thing can't take out the trash and feed my dog.

https://sw.kovidgoyal.net/kitty/actions/#miscellaneous

Mappable actions

The actions described below can be mapped to any key press or mouse action using the map and mouse_map directives in kitty.conf. For configuration examples, see the default shortcut links for each ...

kitty
@tbortels thanks I'm very excited to be wrong about this! gonna try to figure out how it works