Place the Cursor at the Mouse Position in Terminal with an Option+Click
Most command line users rely heavily on Terminal keyboard navigation to move about within text files and get around within the Terminal, but Mac OS X has a super simple trick up its sleeve that lets you instantly position the mouse cursor anywhere in the Terminal.
This means no more tabbing around or repeatedly tapping on the arrow keys, you can just point and click to focus the cursor in the Terminal, just like it was the GUI, and it works the same whether the cursor destination is at the beginning/end of a line or smack dab in the center of a text block.
You’ll really want to try this out yourself to get the hang of it, so open any notably sized text document into the command line with your favorite text editor.
Move the cursor anywhere by holding down the Option key and clicking to a position in Terminal
The cursors position in the Terminal window will immediately jump to that position. Keep Option+Clicking around to see how it works, if you click an exact location the cursor goes there, if you aim away from a specific character it will go the line instead.
This may seem like a huge “duh” for most Mac users who stay within the GUI, or anyone who is accustomed to making mouse-based adjustments and edits within the graphical interface of any other app. But because the command line is keyboard centric, there is reasonably limited mouse support, which makes this using the mouse for precision pointing and cursor placement like this pretty awesome. Or maybe us nerds are just easily impressed.
Be sure you’re tracking the cursor properly when doing this, you’ll find the familiar mouse pointer turns into a set crosshair once you’re hovering in the command line, which is pretty easy to lose track of. If you’re having trouble seeing it, consider making the cursor larger for great visibility in general.
Thanks to Peter for sending along this handy tip found on MacWorld.
@coby I don’t see why you think he is “..acting like this is new”.
He is just offering a tip and I can guarantee you that not everyone who owns a Mac knew they could do that.
is this only for mavericks?
Great little trick, but alt+click in Terminal has been in OS X since 10.1 as far as I know. This is ancient, MacWorld did not find anything new so not sure why you’re acting like this is new.
New or not, I for one do appreciate the useful hint. I’ve been using terminal daily since 10.2 and didn’t stumble upon it myself.
I read through this post twice to be sure, and I don’t see that they ever said that this was new. I’ve been using OS X since the public beta, and I used OpenStep/NextStep before that. Until just a couple of months ago, I never knew about this trick, and I was happy to stumble on it while looking up something else. Perhaps you’re an uber OS X guru that knows everything about the OS, so tips like this aren’t useful for you. Why not allow the rest of us to enjoy them even if they’re old news to you? I don’t mind reading about something I already knew. Sometimes it’s nice to be reminded of something that I haven’t used in a while.
I have been using a Mac, sort of, ever since I used the MacInSack–you may not be old enough to remember it–but I never knew this trick, but was always impatient if I had to move the cursor in the terminal. I sure appreciated the hint.