Live data from Hacker News

Entering text in the terminal is complicated

jvns.ca

91–100 of 229 posts

Re: Entering text in the terminal is complicated

#91
post #87
post #7

In bash, if you set $EDITOR to your favorite text editor, you can send the current line to $EDITOR with ctrl-x ctrl-e. After editing the command you can save and exit for the command to execute.

Or even just bind it to ctrl-e in bash: bind '\C-e: edit-and-execute-command'

that sounds horrific. every time you tried to go to the end of the line you'd get interrupted by launching an editor!

Re: Entering text in the terminal is complicated

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

On Sonoma I get:

    The invoked shell does not support interactive features

Re: Entering text in the terminal is complicated

#93

Earlier quoted context omitted.

The larger issue is the times that the Linux UX goes off the rails and the solution turns out to be "You're going to have to bleat this esoteric incantation at the command line." I plugged my laptop into a second monitor the other day and, oops, for whatever Godforsaken reason it didn't auto-detect. Suddenly I'm munging around in `xrandr` to get my screens to work. To its credit, all the major desktop distributions t…

The alternative is "it just won't work". You too can live in that world by simply not trying to fix it. My wife's Macbook won't suspend correctly when it's plugged into a Dell monitor, the monitor going into power save wakes up the laptop. I wish there was an arcane incantation that would fix it, but no, the proprietary walled garden is well locked up, with glossy user-friendly rounded corners everywhere.

This is the most insightful post in the thread -- there's definitely a false dichotomy here. It's not "have to use a terminal" vs "everything works without a need for a terminal ever" -- it's "able to use a terminal to accomplish some goal or recover from Really Bad Thing" vs "Can't Do That Thing / have to factory restore to recover".

Like the way Apple Maps on my iPhone can't save the person to notify when I navigate to Home. I can save a person to be notified to any arbitrary location besides Home. With Home though, the setting simply doesn't save. I'm sure if I had a terminal I could inspect the data involved and manually fix what's wrong, but the 'Apple' or GUI-only approach simply makes that out of the question. Even better, when the corrupted data is cloud-resident I think the answer is often just that it's broken permanently unless you want to create a brand new account.

There are millions of computers out there that just don't work right, or where people can't accomplish some goal they wish they could. That's the flip side of the 'terminal or not' coin. Neither is a good experience for users who aren't technical though. For nerds though the Terminal provides a great deal.

Re: Entering text in the terminal is complicated

#94
post #33
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…

Windows has a new terminal as default that is pretty cool - I install MSYS2 and set it in the new Windows Terminal and it's all good. Gnome Terminal and other terminals on Linux are also pretty cool too. If you want the worst default terminal experience just boot macOS.

Can you explain what's the big appeal of other terminal apps? I have been using Terminal for 21 years without any issue -- but I'm open to trying something else.

Actually I've only this year switched to an "AI enabled" terminal app called Warp.

Re: Entering text in the terminal is complicated

#95

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 you have a problem with gnu/linux (as opposed to android) you can usually find the solution on stack overflow, server fault, or superuser, but the solution you find there is going to be a textual command line, not a gui. gpt-4 can tell you how to solve the problem, but only using a textual command line, not a gui. text is the most powerful, useful, effective communication technology ever, period. always bet on text: https://graydon2.dreamwidth.org/193447.html

https://news.ycombinator.com/item?id=40909185 documents that this is actually also true for microsoft windows

on the other hand, 'always bet on text' doesn't mean 'always bet on editing your command line with inconsistent control-character commands in a mode where clicking with the mouse doesn't do anything'

Re: Entering text in the terminal is complicated

#96
the top three default readline keybindings that would improve people's lives if they knew about them:

- control-w, which julia mentions in the post, to delete the last word

- control-o: when you're recalling a line from history, edited or no, runs the line and recalls the following line from history. so you can run a sequence of five commands from history by navigating to the first one and hitting control-o five times

- control-r: search backwards in time through your history as you type a search string. control-r again jumps to the previous hit, control-s goes back forward in time. hitting enter or control-o executes it

Re: Entering text in the terminal is complicated

#97
post #52

So when I use Windows Terminal and I press Ctrl-C, it always does the right thing: If I’m selecting text I want to copy it, if I’m not selecting text I want to kill the running process. On Linux, every Terminal app I’ve used stubbornly refuses to copy when I press Ctrl-C, demanding I press Ctrl-Shift-C. When I paste, if I forget my manners and use Ctrl-V instead of Ctrl-Shift-V, I am punished by getting a weird chara…

Its funny, the thing which most keeps me on a Mac is simply the disambiguation of copy vs kill (Command-C vs Ctrl-c) in the terminal.

Re: Entering text in the terminal is complicated

#98
post #29
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!

I wonder what terminal that is, because the Home and End keys, which I'm pretty sure are the expected alternatives, work fine in every terminal for me on Linux.

I feel like you're being willfully obtuse here. I can't remember the last time I used a laptop which had Home / End keys.

Edit: actually I do remember -- it was an HP ProBook from 2011.

Re: Entering text in the terminal is complicated

#99
post #96

the top three default readline keybindings that would improve people's lives if they knew about them: - control-w, which julia mentions in the post, to delete the last word - control-o: when you're recalling a line from history, edited or no, runs the line and recalls the following line from history . so you can run a sequence of five commands from history by navigating to the first one and hitting control-o five tim…

Oh I always do ctrl+shift+r for that last bit, like reverse-tabbing on a gui. Good to know about ctrl+s, though I imagine muscle memory will prevent me for ever using it. :)

Re: Entering text in the terminal is complicated

#100
post #91
post #87

Earlier quoted context omitted.

Or even just bind it to ctrl-e in bash: bind '\C-e: edit-and-execute-command'

that sounds horrific. every time you tried to go to the end of the line you'd get interrupted by launching an editor!

I always just use the home and end buttons for that kind of thing.
Post reply on HN