Select/copy/paste in terminal using only the keyboard
Solution 1:
I always use Ctrl+Shift+C and Ctrl+Shift+V to copy and paste in my (non tmux) terminal.
You can change these keyboard shortcuts in the keyboard preferences of your (non-tmux) terminal.
If however you want to keep using tmux you can also change the keyboard shortcuts of tmux by adding commands to ~/.tmux.conf
. simply add the following in that file:
bind-key -n [shortcut. for example Ctrl+v is C-v] [what you want to do. for example 'new-window' etc]
It will look like this
bind-key -n C-t new-window
You don't need the command prefix key to execute the commands in the ~/.tmux.conf
file.
For more info about the things available for ~/.tmux.conf
check this link
Very rudimentary copying and pasting can be done using this however for a bit more usefulness I recommend using a Vim-style copy/paste config.
Enabling a Vim-style of copy/paste can be done with this config file or another config file. These do however require the use of the prefix key.
Someone even made a tmux extension to simplify the copy/paste action to the system clipboard in tmux. It might be worth a look.
If you want an alternative for Tmux you might try dvtm (sudo apt-get install dvtm dtach
). I haven't used it myself but it looks like it has similar options.
Solution 2:
You could use screen
selection mode.
Enter a screen session using screen
command.
Then, use Ctrl+a and Esc to enter into the selection mode.
You can then move your cursor, select some text using space, quit the selection mode, and paste it when you want with Ctrl+a and ].
More information here: http://web.mit.edu/gnu/doc/html/screen_11.html