Questions tagged [tmux]

tmux is a terminal multiplexer: it enables a number of terminals (or windows), each running a separate program, to be created, accessed, and controlled from a single screen. tmux may be detached from a screen and continue running in the background, then later reattached.

tmux is intended to be a simple, modern, BSD-licensed alternative to programs such as GNU screen.

When tmux is started it creates a new session with a single window and displays it on screen. A status line at the bottom of the screen shows information on the current session and is used to enter interactive commands.

A session is a single collection of pseudo terminals under the management of tmux. Each session has one or more windows linked to it. A window occupies the entire screen and may be split into rectangular panes, each of which is a separate pseudo terminal


Resources


Related tags

1849 questions
94
votes
14 answers

How to auto-update SSH agent environment variables when attaching to existing tmux sessions?

I am trying to find a nice way to restore the SSH agent when I reconnect a disconnected tmux session. The cause seems to be that the SSH agent session changes but the environment variable from the tmux session is not updated. How can I automate…
sorin
  • 161,544
  • 178
  • 535
  • 806
92
votes
4 answers

How to enable scrolling in tmux panels with mouse wheel?

Need to enable scrolling into tmux panels with mouse wheel. How can I get that tips? Can I use it (if its exist of course) with mouse-select-pane on option?
mart7ini
  • 1,519
  • 2
  • 16
  • 21
89
votes
6 answers

How can you tell which pane in Tmux is focused?

I'm starting to use tmux (I'm thinking of switching from screen), but I'm having a hard time telling which pane is focused when I split a window into multiple panes. Is there a config customization or something that can highlight the focused pane a…
dan
  • 43,914
  • 47
  • 153
  • 254
80
votes
5 answers

Bash scripts with tmux to launch a 4-paned window

Can anyone help explain what's going on with tmux, bash, and exec? I'm trying to set up a tmux session with a 4-pane window. Ideally, I want to run a command in 3 of the panes: e.g. a Ruby Thin server and a couple of Ruby daemons. This is what I…
Aaron Gibralter
  • 4,773
  • 3
  • 35
  • 50
80
votes
9 answers

Home/End keys do not work in tmux

I'm currently using tmux with xterm-256color $TERM variable. When in bash under tmux, pressing home/end would insert tilde characters (~). Outside of tmux the home/end keys work fine. Using cat and tput, I could see that there was a mismatch…
Ben Davis
  • 13,112
  • 10
  • 50
  • 65
80
votes
3 answers

Split pane switching in tmux: switch once per command

I've been a happy tmux user for a while now but there's one behaviour that's bugging me. When I switch panes using ^b-arrow, and then immediately press arrow-up (to get a command from history, for example), the window pane switches again. I…
SteakTartaar
  • 929
  • 1
  • 6
  • 6
77
votes
2 answers

If I set key bind of C-b to c-a in tmux how can I move the cursor to the beginning of the line?

I just move from GNU screen to tmux, in screen when I hit C-a, then type a again can take me to the beginning of the line, I wonder if I stick with C-a in tmux how can I work around this?
mko
  • 21,334
  • 49
  • 130
  • 191
73
votes
11 answers

Tmux borders displayed as x q instead of lines?

I'm having trouble getting tmux to display lines for borders. They are being created with x and q. It's a debian squeeze server and the locale is set to en_US UTF8. I also tried adding # instructs tmux to expect UTF-8 sequences setw -g utf8…
maplebonsai
  • 733
  • 1
  • 6
  • 4
72
votes
11 answers

Why am I getting a "failed to connect to server" message from tmux when I try to list sessions?

Here's what's happening to me: I start tmux sessions using tmux -L name1, tmux -L name2; then I detatch them using ctrl+B+d. Then I try to get a list of the currently running sessions on my computer. However, when I run tmux ls, I get an error…
thinke365
  • 1,305
  • 3
  • 14
  • 22
72
votes
8 answers

How to copy and paste between different tmux panes running vim instances

Example: copy in one tmux pane (via vim), then switch to another pane (running another vim instance) and paste using the vim paste command. I know this can be done via tmux (using prefix+]) but it would be really handy if I can copy and paste using…
gylaz
  • 13,221
  • 8
  • 52
  • 58
71
votes
11 answers

How to automatically rename tmux windows to the current directory

I would like to have tmux to automatically rename the window with the current working directory (cwd). As it is by default, it names the tab/window as the name of the current process, such as zsh or vim. When I open a new window in tmux, the name is…
aharris88
  • 3,560
  • 3
  • 27
  • 45
69
votes
1 answer

tmux send-keys syntax

On the tmux man page I found no reference to how it names keys. For example, to send ctrl + r to tmux you would do: tmux send-keys C-r and to send the esc key you do tmux send-keys Escape Is there a list which maps keyboard keys to how tmux…
xxjjnn
  • 14,591
  • 19
  • 61
  • 94
68
votes
1 answer

Howto go to beginning of line in tmux after remapping prefix to CTRL+A?

following the suggestion in this Archlinux wiki, in the page about tmux I remapped the command key prefix to C-a, to mimic GNU screen and to have something easier on the keyboard than C-b. So my .tmux.conf became this: set -g default-terminal…
MetalElf0
  • 1,087
  • 1
  • 8
  • 11
67
votes
4 answers

TMUX using HJKL to navigate panes

Standard TMUX is set to use ctrl-b + [up, down, left, right] when navigating between panes. I would like to make it so that I can use ctrl-b (or the prefix of my choice) + [h,j,k,l]. I thought I had done this with the following vi key in my…
ApathyBear
  • 9,057
  • 14
  • 56
  • 90
67
votes
5 answers

How do I change the starting directory of a tmux session?

The directory where a tmux session is started in will be the directory that new windows start at. How do I change this starting directory without closing the tmux session?
Adnan
  • 814
  • 1
  • 6
  • 8