Live data from Hacker News

Entering text in the terminal is complicated

jvns.ca

211–220 of 229 posts

Re: Entering text in the terminal is complicated

#211
post #60
post #18

> 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). And the curse of bad defaults strikes again (daily). After the realization that this is a weird default you don't train yourself for 15 years, but change it to your comfortable/common keybinds!

These defaults are not bad if you use Emacs :) Or if you use macOS that (gasp) supports the very same ^A and ^E shortcuts in all edit controls.

They are, you just remap them in emacs and Mac as well

There is no point in suffering for decades just because some bad defaults exist elsewhere

Re: Entering text in the terminal is complicated

#212
post #18

> 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). And the curse of bad defaults strikes again (daily). After the realization that this is a weird default you don't train yourself for 15 years, but change it to your comfortable/common keybinds!

Remaps Capslock to Ctrl and it will make a lot of sense. Other heavily used shortcuts are Alt+d, Alt+Backspace, and Alt+Left|Right.

Still wouldn't, why would you use your weakest finger in the bad sideways motion for such a frequent operation???

Re: Entering text in the terminal is complicated

#213
post #84

Earlier quoted context omitted.

Programs like zsh, bash, ksh, fish and most TUIs put the terminal into cooked mode so that they can manage the terminals behavior manually. In cooked mode, the terminal is not new line buffered and instead every character is read. The terminal only appears to be new line buffered but is actually being managed by the shell, which then in turn allows the devs to add nice features like manipulating the text buffer to do…

*raw Cooked is when the kernel handles it (cooking it before it gets to your program)

Thanks, that's a good way to remember that.

Re: Entering text in the terminal is complicated

#214
> 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)

Ctrl+LeftArrow and Ctrl+RightArrow also work with every readline-compatible shell and they are much more intuitive, especially if you are not used to terminal text editors.

> it’s very inconsistent between programs

Readline or emulations thereof are pretty common and the de-facto standard. But of course programs can do their own thing if they want to - it's not like GUI text eidtors all have consistent shortcuts.

cat / nc / etc. are not editors at all and therefore don't provide those shortcuts. They take an input stream and forward it.

Re: Entering text in the terminal is complicated

#215
> 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).

That looks like some cognitive problem or ADHD. (Obviously, completely unrelated to intellect.)

> some programs (cat, nc, git commit --, etc) don’t support using arrow keys at all: if you press arrow keys, you’ll just see ^[[D^[[D^[[C^[[C^

I've long argued that the readline-like functionality should be in the kernel. The POSIX line discipline should be replaced or augmented with full blown editing with history recall.

Imagine rlwrap, but always there, all the time, in the TTY driver.

There are downsides, because history wants to be contextual and persistent. The kernel knows what process is making the read() call on the TTY, though, so that could be somehow arranged. Certain new security issues come up also.

Re: Entering text in the terminal is complicated

#216
post #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 cl…

> They very much should, as people who start with bash will have much to unlearn.

Dash on Debian is intended as a light POSIX sh to execute shell scripts. It isn't meant to be your login shell or for interactive use. It makes sense to keep the dependencies light in that context.

Re: Entering text in the terminal is complicated

#217

Earlier quoted context omitted.

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 autop…

> technologically adept, but lifelong windows user

This kind of user is going to have a bad experience with anything that isn't exactly Windows unless they are willing to adapt. The problem isn't that the way Linux does things is bad, it is that it's different from what you are used to. I guarantee that as someone who is at home under Linux dealing with anything on Windows feels just as bad for me as Linux does for you.

Re: Entering text in the terminal is complicated

#218

Earlier quoted context omitted.

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 autop…

> technologically adept, but lifelong windows user Windows power users are also the ones who rant about the lack of video games in the ecosystem. They already have their happy place, and are not a worthwhile target for recruitment.

Some of them are. Namely the ones willing to have an open mind and learn new things. Games in particular are not a problem unless you are set on playing modern online games which require draconian kernel-level DRM.

Re: Entering text in the terminal is complicated

#219
post #88

Earlier quoted context omitted.

>Linux the kernel + some userland without terminal is used by majority of people in the form of Android and Chromebooks. Exactly, so why hasn't the open source community driving free distros taken note of this? Now more than ever, people want out of Windows, but the only they step into the seat of exit craft and see the above cockpit.

> free distros taken note of this? Gnome tries hard to emulate Apple's approach. Results are mixed, but I've seen fans of it. Elementary OS goes in the "normal users" direction, too. OTOH if something goes badly wrong, and you do need to open the hood and follow an arcane tech support recipe, you open a command line, be it Linux. macOS, or Windows. (Not Android or iOS though, where you do a reset + restore dance.) >…

> Yes, here's where they meet Steam Deck, that did take note, and just puts you into a cared-for gaming environment. It can also run a typical desktop. The hardware is proprietary, but the software is (mostly / completely?) free.

The SteamDeck hardware is about as proprietary as any other x86 PC. It's not open source HW but it's also not really all that custom for the most part.

Re: Entering text in the terminal is complicated

#220
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…

> Doesn't Windows, the most popular OS out there, ... The most popular desktop OS. It is nowhere to be found in the Top 500 supercomputers, is nowhere to be found on smartphones, lags in the Cloud, is nowhere to be found in the billions of appliances, etc. > Why isn't that harming Windows? It is harming Windows. That horrible cmd.exe is one of the reason Windows lost in all the other markets and has hardly any market…

> is nowhere to be found in the billions of appliances, etc.

It is unfortunately found in plenty of embedded systems. Usually not in cheap end-user appliances though where it is outpriced due to both the OS license as well as the hardware required.

Post reply on HN