Tmux is a terminal multiplexer. It lets you switch easily between several programs in one terminal, detach them (they keep running in the background) and reattach them to a different terminal.
I love Tmux because using Tmux + Neovim makes a great IDE.
Depending on which Terminal app you are using, some things in Linux if you copy content from within the Tmux session, you can't paste them outside of Tmux, which can be a big pain most of the time.
To solve that problem we are going to install Xclip, it is a command line utility that is designed to run on any system with an X11 implementation and it allows you to use clipboard from your command line.
Install Xclip
sudo apt install xclip
Configure Tmux to use Xclip
Put following script in your tmux configuration file vim ~/.tmux.conf
#for copying to sys clipboard
bind -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "xclip -i -f -selection primary | xclip -i -selection clipboard"
bind -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "xclip -i -f -selection primary | xclip -i -selection clipboard"
bind -T copy-mode-vi C-j send-keys -X copy-pipe-and-cancel "xclip -i -f -selection primary | xclip -i -selection clipboard"
Reload your tmux session usually prefix + r
. And your clipboard from tmux session should work again.