# TMUX - Terminal Multiplexer

## Full Documentation

* [Project page](https://tmux.github.io/)
* [Manual Page](http://man.openbsd.org/OpenBSD-current/man1/tmux.1)

## Why tmux

* Allow starting process in `ssh` sessions that continue to run when the user logsout
* Open the same session on multiple computers
* Hide irrelevant sessions to unclutter the terminal
* and many other things...

## Essential Usage

### In the terminal

* Start a new session: `tmux new -s <session_name>`
* List sessions: `tmux ls`
* Attach to an existing session: `tmux attach -t <session_name>`

### Within a session

The default bind key for tmux is `C-b` (`Ctrl+b`)

* `C-b + d`: detach (session run as background)
* `C-d` : exit (kill session), typing `exit` on all terminals also work
* `C-b + %`: vertical split
* `C-b + "`: horizontal split
* `C-b + :`: enter command
* `C-b + [`: enter scroll/copy mode
* `Esc` or `q`: exit scroll/copy mode

## (More) Advanced Usage

An user-specific config file for tmux should be located at `~/.tmux.conf`

* Enable scrolling by default: enter following command or add it to config file:
  * version 2.1 and up: `set -g mouse on`
  * older versions: `set -g mode-mouse on`

## See also

* <https://egghead.io/courses/wrangle-your-terminal-with-tmux>


---

# 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://b-it-bots.gitbook.io/wiki/gitbook-1/_posts/2018-05-13-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.
