Tag Info

Hot answers tagged

74

The tmux FAQ ( http://tmux.cvs.sourceforge.net/viewvc/tmux/tmux/FAQ ) explicitly advises against setting TERM to anything other than screen or screen-256color in your shell init file, so don't do it! Here's what I use: ~$ which tmux tmux: aliased to TERM=xterm-256color tmux and in in my .tmux.conf: set -g default-terminal "screen-256color" Aliasing ...


68

From their website: How is tmux different from GNU screen? What else does it offer? tmux offers several advantages over screen: a clearly-defined client-server model: windows are independent entities which may be attached simultaneously to multiple sessions and viewed from multiple clients (terminals), as well as moved freely ...


61

The command to do this is join-pane in tmux 1.4. join-pane [-dhv] [-l size | -p percentage] [-s src-pane] [-t dst-pane] (alias: joinp) Like split-window, but instead of splitting dst-pane and creating a new pane, split it and move src-pane into the space. This can be used to reverse break-pane. ...


34

With tmux 1.5, the capture-pane command accepts -S and -E to specify the start and end lines of the capture; negative values can be used to specify lines from the history. Once you have the data in a buffer, you can save it with save-buffer. Here is an example binding (suitable for .tmux.conf) that wraps it all up with a prompt for the filename: bind-key P ...


29

Starting in tmux 1.9 the default-path option was removed, so you need to use the -c option with new-window, and split-window (e.g. by rebinding the c, ", and % bindings to include -c '#{pane_current_path}'). See some of the other answers to this question for details. A relevant feature landed in the tmux SVN trunk in early February 2012. In tmux builds ...


28

join-pane is the answer. I too was having problems with my attempts to use it based on the tmux documentation. I discovered that the -t and -s switches seem to accept [session]:window and not [session:]window. That is to say that specifying the session is optional, but including the : is mandatory. (I am using tmux 1.5) Therefore, in order to add a pane to ...


26

One difference is in how the two act when multiple terminals are attached to a single session. With screen, each attached terminal's view is independent of the others. With tmux, all attached terminals see the same thing. Say you have two terminals attached to a single tmux session. If you type ^B 1 into one terminal, the other terminal also switches to ...


23

A simpler solution for Mac OS-X This builds off of Alex's answer and uses stuff that didn't exist at the time. If you are using homebrew (and if you aren't, why aren't you?) then you can just do this: brew install reattach-to-user-namespace Then in your ~/.tmux.conf: set-option -g default-command "reattach-to-user-namespace -l zsh" # or bash... bind ...


21

Tmux sets the TMUX environment variable in tmux sessions, and sets TERM to screen. This isn't a 100% reliable indicator (for example, you can't easily tell if you're running screen inside tmux or tmux inside screen), but it should be good enough in practice. if ! { [ "$TERM" = "screen" ] && [ -n "$TMUX" ]; } then PS1="@$HOSTNAME $PS1" fi If you ...


21

The reason both clients switch windows at the same time is because they are both connected to the same session (the “current window” is an attribute of the session, not the client). What you can do is link one or more windows into multiple different sessions. Since each session has its own “current window”, you can then switch windows independently in each ...


18

Let me see if I have deciphered your screen configuration correctly: You use something like logfile "%t-screen.log" (probably in a .screenrc file) to configure the name of the log file that will be started later. You use the title <hostname> (C-a A) screen command to set the title of a new window, or you do screen -t <hostname> ssh0 ...


18

Looks like you need this: move-window [-dk] [-s src-window] [-t dst-window] (alias: movew) This is similar to link-window, except the window at src-window is moved to dst-window. Calling movew without parameters moves current window to first free position.


16

tmux 1.7 has a couple of features that can help establish and maintain gapless/packed window numbers: The move-window command learned a new -r option that will renumber all the windows in a session (either the current session, or one specified with the -t option). If you have a set of windows like { 1:A, 4:B, 15:C }, then you can run move-window -r to ...


15

There are many options given in the manual. (See the OPTIONS section.) Create an RC file: ~/.tmux.conf. The contents below enables UTF-8, sets the right TERM type, and draws the status bar with a black background and white foreground. set status-utf8 on set utf8 on set -g default-terminal "screen-256color" set -g status-bg black set -g status-fg white ...


13

From https://github.com/zolrath/wemux: wemux enhances tmux to make multi-user terminal multiplexing both easier and more powerful. It allows users to host a wemux server and have clients join in either: Mirror Mode gives clients (another SSH user on your machine) read-only access to the session, allowing them to see you work, or Pair Mode ...


13

tmux is fairly new compared with GNU screen. Advantages / Disadvantages is a tough question, as both programs solve approximately the same problem. tmux is BSD licensed, however while screen is GNU GPL. This matters to some people. screen is more represented (on linux) at the moment, that is, you are more likely to find it on a given linux box than ...


13

Here documents need newlines. For example, in a shell script, you can write cat <<EOF >somefile; echo done file contents EOF I don't think tmux lets you put newlines there, and even if it did, this wouldn't be a good approach. What if the data itself contains HERE alone on a line (e.g. because you're copying your .tmux.conf)? I suggest to write ...


13

This depends on the value of history-limit that you have set in your .tmux.conf - the default is 2000; if you wish to capture more, you will need to explicitly set the number of lines. To capture the entire scrollback, enter copy mode, select the entire scrollback, and yank it into the buffer, then paste it into your file. How you accomplish this will ...


13

Solarized gives very specific colours. You can't really achieve these colours in a standard 256 colour palette. The only way you can achieve this is through setting up the exact colours in your terminal emulator, then apps think they're just using standard 16 colours (8 + 8 brights) but these have been accurately mapped to the Solarized palette. Gnome ...


12

Try setting 256 colors explicitly in your bashrc or zshrc: export TERM=xterm-256color or export TERM=screen-256color If you have problems with tmux not clearing the background colors correctly when using the screen term setting, you can try: export TERM=screen-256color-bce


12

There are several levels of configuration that need to be set up correctly for the best functionality. Configure tmux to recognize the sequences. Before launching tmux, set a TERM value that is appropriate for your terminal emulator (e.g. xterm-256color). The terminfo database entry identified by the TERM environment variable tells tmux how to recognize ...


12

The specific problem you are seeing has to do with the name/title of window 4. A combination of being too long (obviously) and containing strange characters which cause tmux to measure it as being shorter (so it fails to properly limit the status bar to the width of the screen) I am not sure how to reset it (on mine it tracks the name of the foreground ...


12

tmux and screen have different models so there is no exact equivalent. In screen terms, a split lets you display multiple windows at the same time. next (C-a n) rotates windows through the active part of the split; this lets you rotate “hidden” windows through the active region of the split. In tmux terms, a split divides a window into one or more panes. ...


11

The biggest difference in my use has been that in Gnu Screen you can only split frames horizontally, whereas in Tmux you can split both horizontally and vertically. This is kind of a moving target, though as I here tell that vertical split is making it's way into screen. Other then that, things are about flat.


11

Super_L is an X keysym. Tmux runs in a terminal. It is up to your terminal emulator to transform a keysym into a character sequence. So you would have to configure both your terminal emulator and tmux. Looking at the tmux documentation, the prefix can only been a known key name with an optional modifier. So you can set the tmux prefix to a key combination ...


10

When you run ssh example.com, the ssh daemon starts a login shell for you, and the login shell reads your ~/.profile (or ~/.bash_profile or ~/.zprofile or ~/.login depending on your login shell). When you specify a command to run remotely (with or without -t), the ssh daemon starts an ordinary shell, so your .profile is not read. Remedy: ssh example.com -t ...


10

The feature request Michael Mrozek mentioned has been closed with the feature being available in the next release (1.7). The request says you can test it out now by building from SVN. If you use Homebrew on Mac OS X you could (theoretically) just do brew upgrade --HEAD tmux. Unfortunately I upgrade to Xcode 4.3 which seems to be missing autoconf/automake.


10

You can use the "kill-pane" command. kill-pane [-a] [-t target-pane] (alias: killp) Destroy the given pane. If no panes remain in the containing window, it is also destroyed. The -a option kills all but the pane given with -t. So, for example if you want to kill all the panes except for pane 0: kill-pane -a -t 0 If you don't ...


10

You have a couple of options. Instead of running ls in your window, run a shell, then send the shell keystrokes to execute: tmux start-server tmux new-session -d -s session tmux new-window -t session:1 tmux send-keys -t session:1 ls C-m You can lunch a sequence of commands in such a way as to leave yourself with a bash shell after your other ...


10

If you're using OS X's Terminal.app, it will capture Page up/down keypresses and just scroll the window contents, as if you used the scroll bar. You can use Shift+Page up/down to send them to the application inside the terminal. Using that, you should be able to scroll by a page at a time using: Control+B [ Arrows keys or Shift+Page up/down Control+C when ...



Only top voted, non community-wiki answers of a minimum length are eligible