Option-Click to Reposition Cursor in Terminal
I found this on SuperUser today and just have to share it.
In Terminal, you can reposition the cursor on a line by option-clicking where you want it to go. Credit where due.
It doesn’t happen every day, but certainly a few times a week: I end up with a monster command, spanning two full 100 character wide lines or more. Inevitably, there’s an error in there in the middle, and I sit waiting, holding down left-arrow to fix it and try again.
Don’t forget about the emacs key-bindings. Even if you are no emacs-fan, these are really handy to use:
^a – start of line
^e – end of line
But for you, with long command lines that you want to “fix” – escape-b (back by word) and escape-f( forward-by-word) are great frustration-saviors.
I’m very familiar with ^A and ^E and have been mapping them in my .inputrc to the home and end keys for years. I’ll give escape-b and escape-f a try next time I’m in this situation, though I do wish there was a version using a modifier key. It’s much faster to hold down the modifier and hammer on the letter than to alternate two keys.
Thanks for the tip – this will save me a lot of time!