> 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.
Entering text in the terminal is complicated
101–110 of 229 posts
Re: Entering text in the terminal is complicated
#102This 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
If I remember correctly, macos bash (3.2) is 19 years old. I don't think I tested it with that version back then.
Re: Entering text in the terminal is complicated
#103Another neat trick is to use ctrl-x ctrl-e, this gets the command in a vim buffer (default editor for me). Edit the command and then :wq to reflect the changes
Re: Entering text in the terminal is complicated
#104I 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.
Re: Entering text in the terminal is complicated
#105Here's a video:
https://github.com/colmmacc/jot/raw/master/jot-demo.mp4
and the CVS repository for the Unix terminal IM client it is part of is at: https://c-hey.redbrick.dcu.ie/src/c-hey_cvs_latest/
It tracks and redraws your cursor when you move up and down between lines, and also pays attention to SIGWINCH to redraw things when the terminal size changes. I've never had the time to rewrite it in Rust, but I'd like to and then release it as a small library.It's always surprised me that nobody else has done this.
Re: Entering text in the terminal is complicated
#106Earlier quoted context omitted.
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.
Re: Entering text in the terminal is complicated
#107So 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…
Re: Entering text in the terminal is complicated
#108Earlier 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!
Re: Entering text in the terminal is complicated
#109Earlier quoted context omitted.
I've always configured my terminal to copy on select. I never press ctrl-c. I mean, why would I want to select text if not to copy it?
E.g., to press Ctrl-(Shift)-V and replace the selection with something you copied (to the buffer / clipboard) earlier?
Re: Entering text in the terminal is complicated
#110"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…
going to a particular column number is not useful to me because my commands are not on punched cards with column numbers printed on them. going to a particular piece of text is, and ^r or ^s gets me there with readline (in vi mode or emacs mode). i don't want to mentally count how many characters are on the line before the place i want to go; i have a computer to do that for me
vi movement by words is useful though, and slightly easier than emacs alt-f and alt-b