Live data from Hacker News

Entering text in the terminal is complicated

jvns.ca

71–80 of 229 posts

Re: Entering text in the terminal is complicated

#71
post #70

This is nice. As always, Julia's articles are always a win. Here's some stuff that's missing: Within shell scripts, you can use `stty` to change a lot of stuff about the terminal, including how it deals with inputs. You can rewire all of these defaults and behaviors. Here's an experiment I did a while ago using sh and stty: https://gist.github.com/alganet/63f1dbc97b8fd35f7bb14ec30f79... It is able to capture and unde…

Here's a bonus:

Ever ran a command that left your terminal mangled after it finished? No output, weird chars, etc.

That's lack of proper tty hygiene on the offending command. Instead of killing your terminal, type:

    stty sane
And you'll demangle it.

Re: Entering text in the terminal is complicated

#72
post #71
post #70

This is nice. As always, Julia's articles are always a win. Here's some stuff that's missing: Within shell scripts, you can use `stty` to change a lot of stuff about the terminal, including how it deals with inputs. You can rewire all of these defaults and behaviors. Here's an experiment I did a while ago using sh and stty: https://gist.github.com/alganet/63f1dbc97b8fd35f7bb14ec30f79... It is able to capture and unde…

Here's a bonus: Ever ran a command that left your terminal mangled after it finished? No output, weird chars, etc. That's lack of proper tty hygiene on the offending command. Instead of killing your terminal, type: stty sane And you'll demangle it.

I think the command “reset” does something similar

Re: Entering text in the terminal is complicated

#73
post #71

Earlier quoted context omitted.

Here's a bonus: Ever ran a command that left your terminal mangled after it finished? No output, weird chars, etc. That's lack of proper tty hygiene on the offending command. Instead of killing your terminal, type: stty sane And you'll demangle it.

I think the command “reset” does something similar

You are correct! I think it does a little more (restoring cursor if hidden, etc). If you have it, it is probably better than `stty sane`

Re: Entering text in the terminal is complicated

#75
"The other day I asked what folks on Mastodon find confusing about working in the terminal, and one thing that stood out to me was "editing a command you already typed in".

This really resonated with me: even though entering some text and editing it is a very "basic" task, it took me maybe 15 years of using the terminal every single day to get used to using Ctrl+A to go to the beginning of the line (or Ctrl+E for the end)."

Only took me a year or so to get used to using "v" in vi mode and fc. I am not a "developer" but I prefer textmode command line to GUI. I do not use X11/Wayland/etc.

I learned sh on NetBSD which I still think is one of the best shells available. It's fast. vi mode is the default. People may disagree but I think for editing single a line of text, i.e., a "command", vi mode offers more precision. For example, being able to jump directly to a particular column number.

https://web.archive.org/web/20240528201424if_/https://pubs.o...

   #list previous commands
   fc -l 
   #edit 5th command on the list
   fc 5 
IMO, as a dumb computer user who is not a "developer", this is not complicated. I think terminal emulators are complicated, though. I do not use them.

I believe fc came to POSIX from ksh.

For me, it is not that UNIX is objectively good. It is that the available alternatives are still comparatively bad.

Re: Entering text in the terminal is complicated

#76

I have continually contented that the terminal is the single thing eternally condemning Linux to It's not just entering text. The entire experience is complicated. It's a Concorde jet cockpit[1] (with no labels too), when 95% of the population just wants to fly their drone around[2]. [1] https://qph.cf2.quoracdn.net/main-qimg-2566f4c91b894e4169d77... [2] https://media.thedroningcompany.com/images/tincy/WQZpC56vqMp...

What's condemning Linux to negligible market share is lack of preinstalls. Virtually no one used Windows, either, until Microsoft did everything short of coercing OEMs to bundle and preinstall it during the 3.x era.

Re: Entering text in the terminal is complicated

#77
post #22

Earlier quoted context omitted.

Doesn't Windows, the most popular OS out there, have a cmd.exe terminal thing? Why isn't that harming Windows? The Windows Command Prompt's default experience is worse than most if not all terminals you find on Linux systems. Even in play TTY, you're bound to find that the shortcuts the author mentioned work like a charm. To make my cmd.exe bearable I am using https://chrisant996.github.io/clink tl;dr You're comparin…

Essentially nothing in Windows requires cmd.exe. Having a terminal in a desktop OS isn't a problem. Needing one is. Just like having a GUI isn't a problem for a server OS, but needing one is a problem.

Apple would disagree with you on both counts.

Plus for a long time desktop Windows needed cmd.exe to support login scripts.

Just as people use Linux daily without ever touching the command line. Eg Android, LG smart TVs (webOS), Satellite TV set top boxes (eg Sky Q), home routers, etc.

And if you want to focus on Linux running on laptops, then there are ChromeBooks and the old Asus EeePCs.

The reason desktop Linux isn’t polished is because every time a company invests heavily into desktop Linux, Microsoft undercuts them (like how they sold XP at a loss to thwart Linux in the netbook market). But the fact that Apple could take BSD, Google take Linux, and Nintendo also run BSD on some of their consoles, really speaks volumes about how there’s nothing technically stopping people running a POSIX platform like Linux and still hide the command line from regular users.

Though going back to my “Linux isn’t polished” point, I still think Linux+KDE is a lot more polished than modern Windows. But that’s just my biased opinion.

Re: Entering text in the terminal is complicated

#78
post #42

I think the lowest hanging fruit would be doing something (anything) to improve discovery of commands. I have great grokking abilities but terrible memorization skills, and I end up forgetting how to do what I want to do and maybe even have done before. Browsing man pages for every command is my bane. It's also why I dislike GUI with unlabelled icons, I never remember what each one does.

Maybe try fish? Tab completion will suggest subcommands, and if you type - or -- and hit tab, it will suggest the available options with help text generated from man pages (example: https://flaviocopes.com/images/fish-shell/autocomplete.png). Doesn't really help with positional arguments but it's definitely enhanced the discoverability of many tools for me.

Re: Entering text in the terminal is complicated

#79
post #42

I think the lowest hanging fruit would be doing something (anything) to improve discovery of commands. I have great grokking abilities but terrible memorization skills, and I end up forgetting how to do what I want to do and maybe even have done before. Browsing man pages for every command is my bane. It's also why I dislike GUI with unlabelled icons, I never remember what each one does.

GPT is great at this. I wrote a little program that I can call from a shell. Bashai.py show me a bash one liner that does x. It then shows me the command and asks if I want to run it with or without root. Simple, yet one of the best tools I've ever made for myself.

Re: Entering text in the terminal is complicated

#80

I have continually contented that the terminal is the single thing eternally condemning Linux to It's not just entering text. The entire experience is complicated. It's a Concorde jet cockpit[1] (with no labels too), when 95% of the population just wants to fly their drone around[2]. [1] https://qph.cf2.quoracdn.net/main-qimg-2566f4c91b894e4169d77... [2] https://media.thedroningcompany.com/images/tincy/WQZpC56vqMp...

If the only Linux distributions were in the style of LFS, Gentoo and Arch* you would have a point, but as long as Ubuntu, Mint, OpenSUSE, Fedora, Manjaro and the myriad other user-friendly exist I fail to see the argument. Yes, Ubuntu has a Concorde cockpit behind the scenes and yes, I can access it on my Ubuntu work* laptop and I am grateful that I have that choice. I would hate not having that level of control. Mea…

I have used ubuntu for 2 years now, and its the motivation for the post.

Ubuntu (or really any distro I am aware of) is great for pensioners (email readers) and power users (career linux user), with a protracted and hellishly complicated experience in between (technologically adept, but lifelong windows user).

True, if you just want to fly straight to one of the most popular cities, you can just enter it in the autopilot and it will go there. But if you want to go anywhere or do anything else, you better be good a googling and understanding "how to fly a Concorde".

Post reply on HN