Live data from Hacker News

Closing a stale SSH connection

davidisaksson.dev

71–80 of 91 posts

Re: Closing a stale SSH connection

#71
post #56

Earlier quoted context omitted.

~ is also the (very common) shorthand for home directory. How do Nordic keyboard users deal with that?

As a former user of ISO layout keyboards, IMHO a great quality of life improvement is to switch to ANSI. A US ANSI keyboard has all programming symbols in the right place. Yet it makes Latin/Nordic and other symbols easy to type via compose key (e.g. Right Alt), or similar. For example, Compose a + ' = á, a + e = æ, o + / = ø, s + s = ß, s + o = §, etc. An annoying issue is that most brands won't sell ANSI keyboards…

I use the french azerty layout (fr-pc) on macOS (equivalent fr-latin9 on linux). It is an ISO keyboard, I am able to do all of the examples you wrote, and more: option b is ß, ã is option ~ and a, "é" is its own key, so is "à" or "ç".

I am able to write 120 words per minute, not so special, but good enough for me. I find the ansi/qwerty too slow with its compose system (I tried on the canadian-intl layout made for Québec).

Re: Closing a stale SSH connection

#72
post #65

Earlier quoted context omitted.

~ is also the (very common) shorthand for home directory. How do Nordic keyboard users deal with that?

${HOME}

Anecdata, but after having some programs break when I used `~` to refer to my home directory (can't remember, was a long time ago), I got into the habit of either using `${HOME}` if I'm in a shell, or just writing the full path explicitly if it's a config file.

So nowadays I only use `~` when I'm navigating in an interactive shell session, and never in commands or config files.

Re: Closing a stale SSH connection

#73
post #65

Earlier quoted context omitted.

~ is also the (very common) shorthand for home directory. How do Nordic keyboard users deal with that?

${HOME}

Yes, programming with a nordic keyboard is slightly inconvenient because ~, {, }, [, ], and | all require AltGr. (Isn't that the same for German keyboard?)

I had to switch over 25 years ago when moving. I just considered it a minor inconvenience. I don't think my programming output really suffers, there are so many other factors. Some (very few) people (native or foreigners) do use different keyboards for that reason. I have not noted that they would be better or faster programmers for that. I would claim the correlation between programming fast and introducing more bugs is much clearer.

As for the dead key, pressing tilde space is not the optimal solution. Especially if you are using ssh over ssh. That means you need to produce 2 tilde characters to control the inner ssh. I prefer pressing tilde tilde. With nested ssh that makes 4 tilde characters. Much easier to type than tilde space because you just hold the AltGr key during all for 4 key presses.

Re: Closing a stale SSH connection

#74
post #58

Earlier quoted context omitted.

> Bonus points to everyone who has an actual VT240 on their physical desktop. Bonus points to anyone who can find one and get it to work. I want one, but it's a huge investment (both in price and effort)

The MAME emulator will actually run a VT260 rom, allowing the emulated serial port to be output to a socket.

MAME is just crazy. I only learned recently it contains the best Sega Genesis emulator and now you tell me it does terminal emulation, too.

Re: Closing a stale SSH connection

#77
post #34

One caveat here is the note: > (Note that escapes are only recognized immediately after newline.) This means that it is easy to pick up a habit to smash the enter-button a few times before doing this dance, and as noted on a nordic layout it can be a bit tricky and since you might seldom do it you might do it a few times. Problem can be that sometimes the connection is only broken one way, what you are typing goes to…

> Problem can be that sometimes the connection is only broken one way

Many network engineers who have to deal with asynchronous routing have had to deal with this particular issue. You got into the habit of doing a ctrl+u ctrl+k just in case, and you get hyper-aware that pressing the enter key has consequences.

Re: Closing a stale SSH connection

#79
post #29

Earlier quoted context omitted.

Alternatively just use jump hosts: $(ssh -J bastion target)

Oh, I didn't know about the -J option. At $WORK, after ssh-ing onto the jump host, we've to do 'sudo -u special_user sudosh' (no password) before we ssh further. I don't suppose there's any way around that, is there?

ProxyCommand may help you; see [0]

[0] https://sshmenu.sourceforge.net/articles/transparent-mulitho...

Post reply on HN