Hacker News new | ask | show | jobs
by tedunangst 1852 days ago
If the application switched to key press mode, you're not going to be able to type reset.
2 comments

Well, from what I've read all alphanumeric can be typed just fine, they go as is to terminal, problem is with special keys that some of them emit escape sequences that confuse shell or combinations of those.

But not to trust what I just read I've installed kitty and tested it and you can type in the "reset" just fine. I hit a bit of a problem with "Entering" it, as apparently if you have numlock enabled (which I do on login) pressing "Enter" sends escape code: "^[[13;129u", but if you disable numlock it is typed in as per documentation: "0x0d - for the Enter key", which in any ascii table is Carriage Return.

And yes, issuing reset restored normal terminal operation.

If you enable all key events there's going to be a "key release" event between the r and e and all subsequent letters of reset.
Some terminals can issue a reset from "the outside", e.g., iTerm2 has this under ⌘K. (In fact, `reset` inside iTerm2 fails to completely reset the terminal…)

Every now and they I'll want to do ^K in Vim and inadvertently hit ⌘K instead, which is fun. (`:redraw!` sorts things back out. Though weirdly it occurs to me that now that the terminal seems to somehow remain in alternate mode…)

If the terminal is in a completely invalid state, closing it is always an option
Yes, in such a case, use the terminals native reset capabilities. And hopefully someday shells will learn how to interpret the full keyboard protocol, making it possible to type reset in any mode.