Tag Info

Hot answers tagged

91

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 ...


78

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. To simplify this, I have these binds in ...


76

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 ...


56

This should work: # move x clipboard into tmux paste buffer bind C-p run "tmux set-buffer \"$(xclip -o)\"; tmux paste-buffer" # move tmux copy buffer into x clipboard bind C-y run "tmux save-buffer - | xclip -i"


49

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 ...


44

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 ...


41

Pretty awesome hack, if you need your tmux working and not want to lose all your sessions: $ tmux attach protocol version mismatch (client 7, server 6) $ pgrep tmux 3429 $ /proc/3429/exe attach original post on Google Plus - https://plus.google.com/110139418387705691470/posts/BebrBSXMkBp


39

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 ...


38

Vertically select-layout even-vertical Usually assigned to: C-b M-2 Horizontally select-layout even-horizontal Usually assigned to: C-b M-1


35

The current (1.9a) tmux man page lists an optional -c start-directory parameter for some commands, including new-window and split-window. It also contains the Format variable pane_current_path, which refers to the Current path if available. By combining these, we can open a new window with the current working directory using new-window -c ...


34

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 ...


31

The solution is to modify ~/.tmux.conf to: # Start windows and panes at 1, not 0 set -g base-index 1 set -g pane-base-index 1


28

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 ...


27

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 ...


27

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 ...


23

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.


23

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 ...


23

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 ...


22

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 ...


21

Here's an actual fix. Add the following to .tmux.conf: set -s escape-time 0


21

You can use ctrl-b space to cycle through layouts with even spacing, but that won't necessarily preserve the layout you had.


20

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


20

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 ...


17

Do NOT set it to something like: set -g history-limit 999999999 This will pre-allocate that many lines (and hence memory) for all windows, which is going to cripple your machine the more history is stored over time. Set it to something large, by all means but not THIS large.


16

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 ...


16

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 ...


15

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 ...


15

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 ...


15

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 ...


14

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 ...



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