Ubuntu – Text selection CTRL+SHIFT+Cursor Keys in shell

command lineguake

I'm using guake and zsh and I'd like to use Ctrl+Shift+Arrows to select word-by-word, Ctrl+Arrows to jump around words, Shift+Arrows to select char-by-char in terminal. This is working as expected in applications like gedit.

Is it possible in any shell?

Best Answer

The only way I know to select text from a shell without using the mouse is using GNU screen.

Quick tutorial:

Note: All GNU Screen commands are of the form: Ctrl+A followed by another key or combination

  1. Install GNU Screen: sudo apt-get install screen
  2. Open screen: screen (or screen myprog my args here)
  3. Run your program, producing the output you want copied
  4. Enter copy mode: Ctrl+A [
  5. Move the cursor to a starting point and hit Enter to start selecting
  6. Move the cursor to the ending point and hit Enter to finish selection
  7. Paste with Ctrl+A ]

Read more: