Hot answers tagged

175

You can use tmux kill-server to cleanly and gracefully kill all tmux open sessions (and server). If you are inside a tmux session you would like to keep, use tmux kill-session -a to close all other sessions. To close a specific session, use tmux list-sessions to identify the session you want to kill, and then use tmux kill-session -t targetSession to kill ...


74

You can easily toggle on/off the use of the F-keys inside of Byobu (tmux) by pressing either: shift-F12 (in tmux) ctrl-a-! (in screen) Full disclosure: I'm the author and maintainer of Byobu.


61

You can use the current (default) settings as a starting point: tmux show -g | cat > ~/.tmux.conf Note the pipe to cat is required for now because of a known bug when redirecting tmux stdout to file.


54

Starting tmux with the following flag fixes this for me: tmux -2 from tmux man page: -2 Force tmux to assume the terminal supports 256 colours.


53

Put the following in your $HOME/.byobu/.tmux.conf: set -g default-shell /usr/bin/zsh set -g default-command /usr/bin/zsh Full disclosure: I'm the author and maintainer of Byobu.


37

Byobu 5.x has excellent support for tmux. New installations of Byobu 5.x and above will default to using tmux as the backend. Upgrades from older versions, however, will not automatically make that switch. Still, you can manually run byobu with tmux by typing byobu-tmux. Similarly, you can manually choose to run with the screen backend by typing byobu-...


34

Sockets are a special file type, similar to TCP/IP sockets, providing inter-process networking protected by the file system's access control. For example, when you open a listening socket in one terminal with netcat: nc -lU socket.sock then send data from another terminal by: echo mytext | nc -U socket.sock mytext appears on the first terminal. By ...


33

Here is the way I did it on Ubuntu 13.04 (Raring Ringtail) and 14.04 (Trusty Tahr): sudo add-apt-repository ppa:pi-rho/dev (source) sudo apt-get update (freshens the cache/database of packages) sudo apt-cache show tmux (*optional, shows you available versions, 1.7 & 1.8 should be listed) sudo apt-get install tmux tmux -V


29

Starting tmux with u flag solves this issue tmux -u I've created an alias of tmux in my zshrc alias tmux='tmux -u'


28

this worked for me in .tmux.conf set -g default-terminal "screen-256color" in .vimrc set term=screen-256color remove old term value for .vimrc, believe me this will work


28

I am having the same problem on Ubuntu 10.04 LTS using Byobu 5.17 & tmux 1.5 using the latest Solarized from the GitHub repo. I was able to partially fix this by specifying $TERM in the .bashrc file: export TERM="xterm-256color" It seems, also, that there is a bug filed on launchpad, but it is not yet resolved: byobu not displaying dircolors properly


27

Byobu is simply a shell for the tmux (or screen) back end terminal multiplexor. You can therefore pass any command that your back end supports through Byobu. Byobu with tmux back end To start a new Byobu session with a specified name: byobu new -s <session-name> To change the name of a pre-existing session: byobu rename -t <session-name> <...


27

Terminator is easy to install and it does exactly what it's supposed to do - it can split terminal windows both horizontally and vertically, according to user's requirements. It also allows to keep multiple tabs opened in case splitting one window is not enough. Tmux lies somewhere between Terminator and screen, combining ease of use with basing on the ...


26

You have to preserve bash history in multiple bash shells. To do this, be sure that you have the following lines in your ~/.bashrc file: # avoid duplicates.. export HISTCONTROL=ignoredups:erasedups # append history entries.. shopt -s histappend # After each command, save and reload history export PROMPT_COMMAND="history -a; history -c; history -r; $...


25

Great question! This isn't directly possible, due to the way Tmux works, from a client-server perspective. Nonetheless, there is a viable workaround... Basically, you just need to have separate sessions. Byobu makes this easy and convenient through a couple of keybindings. F2 creates new windows Alt-Left and Alt-Right moves back and forth between them ...


21

12.04 AND UP: sudo add-apt-repository ppa:pi-rho/dev sudo apt-get update sudo apt-get install tmux OLD ANSWER: As you possibly already realized, tmux version 1.8 is too new. As of writing this answer, version 1.8 is only 19 hours old. If you for some reason need a newest version, then you might download the code and build/install tmux by yourself. Should ...


20

I'm assuming that you configured byobu to use Ctrl-A as tmux's escape sequence. The commands that you type in your terminal are first handled by your local tmux instance, then handled by the nested tmux session. This means you need to escape twice to go to the nested instance: Ctrl-a c # opens a window in your local session Ctrl-a Ctrl-a c # opens a ...


20

To add up with all the answers said about the question. I have been a user of both Terminator and Tmux, but right this moment I switched to tmux in xterm. My experience has been great over the decision because ; In tmux i can: Predefine layouts, and with these layouts I can use attach commands which will run in each specified pane and then attach some key ...


20

I want to see what is going on in one session I created. As far as I know, you can view your tmux sessions list by using tmux list-sessions to see what sessions are currently running on tmux. To actually see what is running in those sessions you have to attach to the particular session, to do this you have two options (from experience). If you are not ...


20

Another option is to create an alias or another shell file in /bin for: tmux new-session \; split-window -h \; split-window -v \; attach or tmux source-file ~/.tmux.conf where ~/.tmux.conf new neww splitw -h splitw -v For reference, same question has other options in SE, How to set up tmux so that it starts up with specified windows opened?


19

The proper solution is to disable the offending systemd behavior system-wide. Edit /etc/systemd/logind.conf (you must sudo, of course) and set KillUserProcesses=no You can also put this setting in a separate file, e.g. /etc/systemd/logind.conf.d/99-dont-kill-user-processes.conf. Then restart systemd-logind.service. sudo systemctl restart systemd-logind


18

A unix domain socket is a bidirectional pipe similar to a TCP/IP socket. A server listens for and accepts connections from clients, and then can communicate with the client on the newly accepted connection. What is special about unix domain sockets is that instead of having an IP address and port number, they have a file name as their address. This allows ...


17

This would list and kill all the sessions: tmux list-sessions | awk 'BEGIN{FS=":"}{print $1}' | xargs -n 1 tmux kill-session -t


16

As per dpkg -L tmux which shows you what files the package installed, there is no default tmux.conf included in the package. /etc/tmux.conf is just a location that you may use (only makes sense with multiple users using tmux) that will be evaluated before ~/.tmux.conf. You have to create your own .conf file. Have a look at this for example (first hit on ...


16

I found using Shift-F12 to toggle on/off the outer byobu's keybindings is a bit easier to remember and use. The only new key to remember is Shift-F12, and then the inner byobu can be controlled with the normal F- keybindings. Found that solution here.


16

You're right about Alt-F12, for toggling mouse mode on and off. As for scrolling in the Byobu, you'd need to enter scrollback mode, using F7.


15

After reading it here I changed the session so that "Terminal → Keyboard" has the option "Xterm R6" selected.


15

You can use following shell script for your configuration: #!/bin/sh tmux new-session -s "mySession" -d tmux split-window -h tmux split-window -v tmux -2 attach-session -d This will give the required configuration of the screen with following commands as you mentioned. tmux --> Ctrl+b+% --> Ctrl+b+" For reference please use tmux man page.


14

There is an option set-clipboard that will try to copy your selection to the x-clipboard with an escape sequence. :set-option -s set-clipboard off gnome-terminal does not support this method of using the clipboard, which is the default terminal in Ubuntu.


14

I can kill all of these processes with the command: pkill -f tmux It kills all processes (full list) of the matching name (tmux). Note for newcomers: This way could serve you to kill all process of other matching names.


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