Live data from Hacker News

"Rules" that terminal programs follow

jvns.ca

51–60 of 153 posts

Re: "Rules" that terminal programs follow

#51
The main reason I enjoy CLIs so much more than GUIs (or eves TUIs sometimes) is that it feels so consistent.

There are conventions, but following all the conventions in a CLI is a lot easier than designing a good GUI. So they tend to be higher quality as a result.

I spend a lot of time thinking how to bring this property to GUIs, but my best answers are still "lots of effort" or "lower your expectations".

Re: "Rules" that terminal programs follow

#54

Ctrl-D for REPLs always bites me with GHCi. My usual approach to quitting GHCi is: - Press Ctrl-D, like normal - Get confused when nothing happens - Remember that it doesn't work in GHCi, so run `:q` instead - Get an error message about "lexical error at character '\EOT'", due to Ctrl-D inserting an invisible char at the start of the input - Try `:q` again, without any invisible prefix - GHCi successfully quits

You think that's hard, try getting out of vi when you're on a keyboard from an unfamiliar country.

Do keyboards in unfamiliar countries not have the colon key?

Re: "Rules" that terminal programs follow

#56

Earlier quoted context omitted.

You think that's hard, try getting out of vi when you're on a keyboard from an unfamiliar country.

Do keyboards in unfamiliar countries not have the colon key?

Both the colon and Q keys can be in different places, which can really mess with your muscle memory.

Re: "Rules" that terminal programs follow

#57
post #46
post #45

What does "cooked" mode mean in the context of this article?

It means that the keystrokes you type aren't just immediately handled to the application in raw form; something higher up the chain (kernel, terminal emulator, shell) is pre-processing ("cooking") them in some way, possibly taking actions before (or in place of) passing the keystrokes to the application. For example, if an application you're using has left things in cooked mode, and you press ctrl+c, the application…

cooked mode also generally gives input to the program a line at a time and handles things like backspace to delete characters, and it handles program output too, doing things like replacing \n with \r\n.

Re: "Rules" that terminal programs follow

#58

Ctrl-D for REPLs always bites me with GHCi. My usual approach to quitting GHCi is: - Press Ctrl-D, like normal - Get confused when nothing happens - Remember that it doesn't work in GHCi, so run `:q` instead - Get an error message about "lexical error at character '\EOT'", due to Ctrl-D inserting an invisible char at the start of the input - Try `:q` again, without any invisible prefix - GHCi successfully quits

You think that's hard, try getting out of vi when you're on a keyboard from an unfamiliar country.

Or if you are like me and have caps mapped as escape.

Vim works really weird when you start typing random capital letters after thinking you were moving somewhere.

Re: "Rules" that terminal programs follow

#59

Ctrl-D for REPLs always bites me with GHCi. My usual approach to quitting GHCi is: - Press Ctrl-D, like normal - Get confused when nothing happens - Remember that it doesn't work in GHCi, so run `:q` instead - Get an error message about "lexical error at character '\EOT'", due to Ctrl-D inserting an invisible char at the start of the input - Try `:q` again, without any invisible prefix - GHCi successfully quits

I always quit GHCi with Ctrl-D. I don't even know how else one is supposed to.

Is there some setting that changes it?

Re: "Rules" that terminal programs follow

#60
post #42

Additional suggestions: * Respect the user's default foreground and background color. Don't change them without good reason. * If you use colors, make them legible regardless of what the default background and foreground colors are, and regardless of the terminal's color map. * Don't use color as the only indication of something. The user's terminal might not display it, and it probably won't be preserved in copy&pas…

[deleted]
Post reply on HN