Selecting text in the Terminal app

By mr grieves, 26 October, 2022

Forum
macOS and Mac Apps

Can anyone describe how to efficiently select text in Terminal? This feels like a fairly basic thing, but so far my solution is to interact with the shell then use VO+Up and Down, then VO+Shift+C to copy last phrase to the clipboard. Which works up to a point but is a pain if there are multiple lines.

I'm sure there's an easier way??

Options

Comments

By PaulMartz on Saturday, October 29, 2022 - 05:40

According the the Edit menu, you can select all with Command+A, and select between marks with command+shift+A.

Through experimentation, I have found that if you VO+Up arrow to a random line of text, you can select that line with VO+shift+A, even without leaving any marks.

It's not at all clear to me how to leave marks, for example, to mark the beginning and end of a block of text that spans multiple lines, for example. It's rather confusing.

Personally, I use TDSR from github, but its text selection mechanism isn't much better.

By KE7ZUM on Saturday, October 29, 2022 - 05:40

try: * vo shift up to find where you want to start the selection, * vo enter to start the selection, * vo down to place your curser on the last line you want to select, * vo enter to stop, * cmd c to copy.

By mr grieves on Saturday, October 29, 2022 - 05:40

I'll have a mess about with marks, thanks.
I've seen a lot on here about tdsr, although I can never remember its name. I did install it but wasn't immediately taken with it. I don't find the normal terminal too bad with VoiceOver, other than text selection. But I'll maybe check that out too if I can't get anywhere with marks.

By KE7ZUM on Saturday, October 29, 2022 - 05:40

I've been doing this since about 2012 or so, in fact, don't laugh, that is how I used to select text in pages in 2010 when I first started using a mac in 2010. I said, don't laugh. lol! I at the time didn't know better.

By mr grieves on Saturday, October 29, 2022 - 05:40

I've had a quick play about and that does seem to do the trick. I had no idea about VO+Enter. No matter how many keyboard shortcuts I think I know, there are always just as many I don't! :)

Thanks so much for the help.

By KE7ZUM on Saturday, October 29, 2022 - 05:40

Lol. any time. I read that somewhere in help almost 13 years ago. lol! Goad it helped. It really is a cool way of selecting stuff.

By mr grieves on Saturday, October 29, 2022 - 05:40

Is it specific to terminal? I've been noticing today that caret browsing isn't working - the cursor keys in Safari, Edge and Chrome are all jumping about all over the place as if I have quick nav on. (I don't.). I thought I'd give VO+Enter a go there, but sadly it didn't seem to work

But I have been using it in Terminal and it's doing exactly what I was hoping for. It's going to be a huge time saver. Note to self: don't wait so long before posting on AppleVis!!

By Jason White on Saturday, October 29, 2022 - 05:40

The version of Vim included in Mac OS can access the clipboard, using the usual "+" register. If you're running Vim as your text editor in the terminal, this functionality can be very useful.

For example, "+p will perform a paste operation. You can copy text from Vim to the clipboard easily, using various "yanking" commands.