Live data from Hacker News

Entering text in the terminal is complicated

jvns.ca

1–10 of 229 posts

Re: Entering text in the terminal is complicated

#3
For me, Ubuntu's terminal is perfect.

Give me arrows, tab, Ctrl+(R/C/D/W) etc and its a great.

But I agree with the point that different systems have their own implementation which could lead to frustration.

I am working on set of servers only accessible through PAM and those admins don't allow anything. It gets so frustrating.

I feel a lot of the frustration also comes from shifting to unfamiliar environment. Like I work on those restricted servers and am cursing the admins, but when I switch to Ubuntu's terminal I am thanking the gods for liberation.

Re: Entering text in the terminal is complicated

#4
Periodic reminder that many emacs-like keybindings exist in almost every text field in macOS: Ctrl A, E, P, N, K, Y, T, and probably others I'm forgetting (start of line, end of line, previous line, next line, kill (delete everything to the end of the line and put it in a special pasteboard), yank (paste from that special pasteboard) and transpose characters).

Edit: more complete list here: https://jblevins.org/log/kbd

Edit 2: can't believe I forgot Ctrl-D, which is forward delete.

Re: Entering text in the terminal is complicated

#8
> some programs (the dash shell, cat, nc, git commit --interactive, etc) don’t support using arrow keys at all.

The dash shell does in fact support an editing mode if compiled with libedit. Debian derivatives do not do so (likely for concerns of space). They very much should, as people who start with bash will have much to unlearn.

The POSIX standard also specifies "set -o vi" as an optional extension. Every shell claiming POSIX-compatibility must support set -o vi if the shell implements this editing mode (so ignore inputrc if it pleases you).

"[set -o] vi: Allow shell command line editing using the built-in vi editor. Enabling vi mode shall disable any other command line editing mode provided as an implementation extension."

https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V...

Re: Entering text in the terminal is complicated

#9
I plan to make one day an alternative to terminals. My idea is not fully fleshed out, but I would like to try to forgo TTYs altogether. Use only pipes, file descriptors and job control.

The closest thing I saw to what I have in mind is this: https://github.com/letoram/cat9/ but more in a way of interface.

Re: Entering text in the terminal is complicated

#10
post #5

It took the author 15 years to learn basic readline commands?

Yeah, I have my doubts about the claim. I forgot what I read way back when as an intro book, but I suspect it was more like a month in my case, if that. But I remember having been surprised at various points that there was an undo (C-_), and a clipboard (C-y to paste) including a history (M-y). So yeah, I guess it depends on the scope.

Maybe it's a hyperbole? Dunno, doesn't really read that way.

Post reply on HN