-
Notifications
You must be signed in to change notification settings - Fork 6
Tmux Usage
Tmux is a highly customizable terminal multiplexer which can be used with many add-ons and own shortcuts.
Our Tmux configuration includes the following files which are responsible of different functionalities:
- Tmux bash functions, which are used as shortcuts to control the main functionalities of the Tmux server and TUI. It also contains a small piece of code that makes that a terminal that has just been created attaches to a tmux session if already exists or creates a new one if there are none. With this we
- Tmux .conf file, which is a configuration file that includes tmux directives that we customized. This is mainly the script that tells us how Tmux looks and behaves.
- Emoji bash function, which is a file that contains a small piece of code which obtains the current time and uses it to obtain the most adequate emoji of a clock for that given time. This script is called to generate the time emoji in our tmux bottom bar.
The first most important thing is that because Tmux works in Terminal it has the mouse deactivated by default, so you can not scroll. You can select text and copy text from a Tmux window by actually using the GUI interface of the terminal window that you are using, in my case gnome-terminal. You can not interact with the actual Tmux elements with the mouse in this mode.
To invert the mouse mode we can use the tm
functions, which adds the line in tmux.conf
that makes Tmux use the mouse. You will need to reload tmux configuration to see the effects with Prefix + r
afterwards. In the opposite way, if we have the mouse active by a configuration line in our tmux.conf
, activating the tm
function will result in the deletion of this line and after reloading configuration you will see that the mouse is now inactive.
We do recommend not mess up a lot with this function tm
in the same tmux session since a buggy behaviour in the mouse is observed if you activate / deactivate mouse too many times. You may close a tmux session and have a fresh start if that happens with the configuration that you want, though.
- Select normally with the mouse if you are in a graphical environment. The terminal GUI interface that you are using will be the one displaying the menus, as when you do not have tmux installed.
- In a Tmux window press
Prefix
&[
, this will make you enter in copy-mode, which is a mode where you can select, scroll and copy text. To start selecting pressSpacebar
. You can move with the arrow keys. You can scape copy mode by pressingq
.
- After selection, right click. The GUI interface of the terminal that you are using will show a drop-down menu where you can click copy.
- After selection,
Ctrl + Shift + c
. This will copy the selection to the system clipboard. - After selection in copy-mode, press
Enter
. This will copy to the
Best regards, and happy coding :)
- The Linux-Auto-Customizer Team