MacOS – Is it possible to select Terminal output by using keyboard keys

keyboardmacosterminal

Often I like to copy output from the terminal into the clipboard.

Currently I'm using the mouse. Select the text so that it is marked. Then "command" plus "c".

In a text-editor or text-processing software you can use the "shift" key (keep it pushed) together with the arrow keys for selecting text. So one needs the mouse less and can keep the hands on the keyboard.

On the terminal that doesn't work. Keeping the "shift" key pushed and pushing the arrow keys just creates this: ;2C;2B;2A;2D;2D;2D;2D;2D

Hexadecimal numbers obviously. Does anyone knows the meaning?

But my actual question is:

Can one select terminal output via keyboard?

Similar to what I have described concerning text-editors.

Best Answer

The terminal multiplexing program tmux has configurable keyboard commands for selecting text for the purpose of copying and pasting. tmux is a very powerful addition to any terminal. It has a high learning curve, but if all you want to do is copy and paste you can learn how in a matter of moments and it will stay completely out of your way until you are ready to take the next step. tmux can be installed directly, or using a package manager such as Macports or Homebrew.