# TMUX

### TMUX Commands

| Description                      | Command                                                           |
| -------------------------------- | ----------------------------------------------------------------- |
| Create a new session             | `tmux new -s <SESSION_NAME>`                                      |
| See any existing sessions        | <p><code>tmux list-sessions</code></p><p><code>tmux ls</code></p> |
| Attach to existing session       | `tmux attach -t <SESSION_NAME>`                                   |
| Make all windows the same size   | `Ctrl+b` THEN `Alt+2`                                             |
| Add new tmux window vertically   | `Ctrl+b` THEN `Shift + @`                                         |
| Add new tmux window horizontally | `Ctrl+b` THEN `%`                                                 |
| Detach from current session      | `Ctrl+b` THEN `d`                                                 |
| Kill current session             | `Ctrl+c`                                                          |
| Highlight text to copy           | `Option + click and drag`                                         |

### Install and configure TMUX

{% code title="Install tmux" %}

```bash
sudo apt-get install -y tmux
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
```

{% endcode %}

{% code title="Create new session" %}

```bash
tmux new -s <SESSION_NAME>
```

{% endcode %}

{% code title="You have to start a session first before these config options exist" %}

```bash
tmux show -g | sed 's/^/set-option -g /' > ~/.tmux.conf
vim ~/.tmux.conf
```

{% endcode %}

* Change `mouse` to `on` globally

{% code title="\~/.tmux.conf" %}

```bash
set-option -g mouse on
```

{% endcode %}

* Change `mouse` to `on` for current session

```bash
tmux set -g mouse on
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.eridian.xyz/general-dev/linux-software/tmux.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
