10.4: Select text areas via the keyboard in Terminal
Jan 20, '06 05:32:00AM
Contributed by: boredzo
This is a menu item, new to Tiger, but who goes searching the menu items of their terminal emulator? Especially those buried in sub-menus?
You can now define the Mac-side text selection (the one you might normally create by clicking and dragging the mouse) using the keyboard in Terminal. Here's how:
- Choose the menu item Edit: Keyboard selection: Start keyboard selection, or just press Command-Option-Return. This command 'unhooks' the arrow keys from input; pressing them in this mode will not send arrow-key characters to the process running in the terminal.
- Use the arrow keys to navigate to the point where you want to start the selection.
- Choose the menu item Edit: Keyboard selection: Anchor selection at cursor, or press Command-Option-Return again. You have now set the start-point for the selection.
- Use the arrow keys to navigate to the point where you want to end the selection. You'll see the highlight appear as you move about; note that it is not a rectangular selection.
- Do what you wish with the selection. You can copy it manually via Command-C, drag the snippet with the mouse, cancel out of text selection mode by hitting Escape, or (easiest of all) just hit Command-Option_Return one more time. When you do, the selected text will be copied to the clipboard, the selection will vanish, the cursor will be back in its original location, and the arrow keys will be back to normal.
[robg adds: This is definitely new to Tiger, and since I'd overlooked it, I figured it might be worth sharing. It may seem clumsy at first, but after I'd tried it a few times, I found it to be a fast way to capture small chunks of Terminal output without reaching for the mouse.]
Comments (5)
Mac OS X Hints
http://hints.macworld.com/article.php?story=20060115014737999