290

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 "#{...


40

Yes, use new-window -c "#{pane_current_path}". You can add the following to your ~/.tmux.conf to make it persistent (assumming default keybindings): bind c new-window -c "#{pane_current_path}" bind '"' split-window -c "#{pane_current_path}" bind % split-window -h -c "#{pane_current_path}" The default-path path setting was removed from upstream code and ...


28

You haven't set window active background color, you only set active panel border, try: set-window-option -g window-status-current-bg red


22

In tmux 1.9a you can do :switch-client -r. I'm not sure if this is new in 1.9a, but that is the version that I am running and I am able to change an existing tmux session to read-only mode.


21

This question is a bit old, but I was looking for something similar, and found it here. It creates a second session that shares windows with the first, but has its own view and cursor. tmux new-session -s alice tmux new-session -t alice -s bob If the sharing is happening between two user accounts, you may still have to mess with permissions (which it ...


20

tl;dr ... | tmux loadb - tmux saveb - | ... Explanation & Background In tmux, all copy/paste activity goes through the buffer stack where the top (index 0) is the most recently copied text and will be used for pasting when no buffer index is explicitly provided with -b. You can inspect the current buffers with tmux list-buffers or the default shortcut ...


16

The added benefit of terminal multiplexers is that your multiplexer sessions will still be alive and you can reconnect to them even if X (your desktop session) crashes, or you logged out of X.


12

One big con for screen is that it is not actively developed. The bug pages have close to 200 unassigned items going back over 5 years. tmux has some open issues as well, but far less, and is more actively supported.


11

Sure, with screen -d -r You can choose which screen to detach and reattach as usual by finding the pid (or complete name) with screen -list. screen -d -r 12345


11

In version 2.9 You should change this options to something like: # Active window title color setw -g window-status-current-style fg=black,bg=white There's an argument with a decent explanation here: https://github.com/tmux/tmux/issues/1689 And the FAQ: https://github.com/tmux/tmux/wiki/FAQ#how-do-i-translate--fg--bg-and--attr-options-into--style-options


10

With recent versions of tmux (v1.8, but maybe in v1.7 too): tmux new-window -c "$PWD"


9

I use dwm and tmux. Before learning to use tmux, I would have multiple terminals open for different things, and have them in different tags. Now I can run everything inside of one tmux session, under a single tag, and can detach and reattach without losing state if I need to restart X.


8

You should be creating screens with names. $ screen -S foo $ screen -list There are screens on: 16994.foo (03/30/15 14:05:13) (Detached) 20082.q (12/17/14 18:06:44) (Detached) 11008.w (11/12/14 10:52:43) (Detached) 1199.irc (11/12/14 01:34:40) (Detached) Then you can reattach screens with $ ...


8

tmux is newer and several more features. I have found that good use depends on good setup. I use vi(vim) for editing (ruby on rails) and there's a few setup things to make that work well. Here's my ~/.tmux.conf file with lot of helpful setting: bind r source-file ~/.tmux.conf \; display "Reloaded!" # Reload with ctrl-r set -g prefix C-a # prefix ...


7

A terminal emulator provides a standardised character based interface for text mode applications, it emulates the behavior of real or idealised hardware. Consoles typically run some sort of terminal emulation, (linux console emulates a VT220 with some additions) A terminal was dedicated hardware that implements the standard and iwas connected to ther ...


6

Multixterm There's a tool called multixterm. It uses xterm terminals. You can invoke it like so: $ multixterm And once up you'll be presented with a GUI.                                  &...


6

Following a comment suggested in the post I used: screen -x <session id> From the man page: screen -x -x Attach to a not detached screen session. (Multi display mode). Screen refuses to attach from within itself. But when cascading multiple screens, loops are not detected; take care. Also researching a bit I discovered other uses for ...


6

Just set another TERM, For example TERM="rxvt" or TERM="xterm" or TERM="vt102" Maybe an export TERM helps too. The TERM variable is used by curses and termcap programs, such as mc or dialog, to read the terminal escape codes from the terminfo/termcap databases, where the command is executed, so in your case in the remote system. To support the "...


5

Finally, I've managed to figure out "obvious" package which supply screen-256-color-s (got to be installed on remote machine): sudo apt install ncurses-term fixed the problem for me: nice 256 colors and no need for ugly workarounds with environment variables. Hooray! :)


4

GNU screen is setting $TERM locally, and ssh is passing that value to the remote side. There are a few things you can do. Detect the screen-256-color-s on the remote side and set to a more sane. From that you can have case $TERM in screen-256*) TERM=screen;; esac. From the local side, have screen set the terminal. In your ~/.screenrc file have: term screen....


4

Instead of >(cmd), assuming it's cmd's stdin you wish be a tty instead of a pipe, you could try and use: >(socat -u - exec:'cmd',pty) socat would use a pseudo-tty pair and have cmd's stdin connected to the slave part ([ -t 0 ] would then return true). The pseudo-terminal will be put in raw mode, so the line discipline should not interfere with the ...


3

You can do this in your terminal configuration. For instance, with Xterm, this can be done via the X resources. You can do this via the Xterm app-defaults: *termName: xterm-256color or via a -tn xterm-256color option. This is similar for rxvt.


3

One approach is to use a terminal multiplexer only on remote machines. Running each shell in a separate terminal emulator has the advantage that you can put multiple shell windows side by side. On a remote machine, resistance to disconnection is a big win that justifies terminal multiplexers, but locally, they have fewer advantages. If you do want to nest ...


3

The other answers does not work for me when I try put them as bindings (specifically tmux split-window -c). But I've made up my own solution that I've been using for more than a year that works for both new-window and splits: ~/.bashrc: PS1="$PS1"'$([ -n "$TMUX" ] && tmux setenv TMUXPWD_$(tmux display -p "#D" | tr -d %) "$PWD")' ~/.tmux.conf: ...


3

Once you've launched screen, you can use its internal screen command to attach windows to additional terminal devices. Type C-a: to get the prompt, then use screen /dev/ttyUSB1 ###### where ###### is this device's baud-rate. You can also put these commands in your .screenrc to attach the devices automatically when you start screen, or you could bind a ...


2

Try vim-slime, an environment inspired by Emacs's SLIME mode. It sends the contents of Vim to a screen or tmux session. In the future you can probably also use Xiki, but for now its Vim support is incomplete.


2

Use both: A tiling window manager, and a terminal multiplexer. Combine both their capabilities and advantages to obtain an even better synergy. On my i3 setup I regularly display several terminals at the same time, but all of them connected to the same tmux session, so I can display all tmux windows in any of the terminals. In effect, I use the tiling ...


2

You could try running two separate tmux sessions at once - one for you, and the second for the other user. Then, use your OS's windowing system to arrange two terminals side by side, with one for you and one for him. If you need to write in his terminal, just choose it for input. You run (each command in its own terminal): tmux new-session -s Alice tmux ...


2

Programs like screen (and tmux) are conceptually similar to, but completely separate from, Gnome-Terminal's idea of tabs. screen runs inside a terminal window (or a single Gnome-Terminal tab) and creates its own "sub-windows". So you can use screen to show two "screen windows" side by side, but you can't use it to do the same with your Gnome Terminal tabs. ...


2

I answered my own question. I'm really happy about this since I've been trying to get it like that and it was such a simple fix. I was actually using prezto, the zsh framework and in my ~/.zpreztorc, I forgot I set it to autotitle my terminal tabs/windows. So I changed: zstyle 'prezto:module:terminal' auto-title 'yes' to zstyle 'prezto:module:...


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