Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Note that these only work at the beginning of a "line", so you may have to hit enter before the tilde.


Yeah. I can understand where they are coming from, at least with tilde as the escape character it would be highly inconvenient if it happened all the time, but I still a bit unhappy about having to press enter before being able to terminate a stuck session. That's usually not something I want to actually send, should the session not be as dead as I thought it was.


And if your terminal state is hosed by a crashed cursor-addressing (curses) program, you may have to use ^J instead of Enter.


Are you sure? I never noticed that. As an experiment, I did this in an ssh session from macOS to OpenBSD:

    stty raw; cat
... and while every key I tried now had its literal effect, including enter producing only a carriage return and Ctrl-C, Ctrl-V etc. producing their control characters (I think, I cannot see them :) ), <enter>~. still terminated the connection. Lucky terminal combination maybe?


Hmm, I just tried it with stty raw and you're right.

It has happened to me though. Maybe a curses crash can leave it a state other than raw? One of the other modes such as inlcr plus ..? Also I suspect smart terminals and shells prevent a interactive session from getting too crazy.


Yeah, come to think of it, it wouldn't really surprise me if some weird terminal state swaps ^J and ^M or something.

Edit: Oh, you mentioned that yourself already, inlcr.


This is very important to know. It often doesn't work and then there's no feedback why.




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

Search: