EzDevInfo.com

tmux interview questions

Top tmux frequently asked interview questions

What's the least conflicting prefix/escape sequence for screen or tmux?

Screen goes with Ctrl+A. tmux on the other hand—as developed within screen—uses Ctrl+B. Both keystrokes, however, are also used in editors, shells, etc. Thus choosing either one degrades the user experience and functionality of those tools when used within tmux or screen.

What prefix conflicts the least with other programs' and shells' keybindings?


Source: (StackOverflow)

tmux exits with [exited] on mac os x

I just installed tmux (a terminal multiplexer) with homebrew. When I try to run it, it always exits with [exited] Nothing shows up.

When I try to run tmux list-session I get an error:

failed to connect to server: Connection refused

I tried running tmux start-server, but again nothing happens.

What can I do?


Source: (StackOverflow)

Advertisements

Move pane to a new window in tmux

I know that it's possible in tmux to join a window as a pane, but is it possible to move a pane to it's own window (tab)? I tried searching it up the man page but couldn't find it. I guess it is possible doing it through a shell script, but is there some other, more elegant way?


Source: (StackOverflow)

How do I scroll in tmux?

I just started using tmux, and I really like it, but I need to be able to scroll within the buffers/panes/windows I have open. I don't care if it works with the mouse or not. When I search the tmux man page, I find only two instances of the word "scroll" even showing up, and both have to do with copy mode. Is there a way to scroll without all the overhead of entering copy mode?


Source: (StackOverflow)

selecting text tmux copy-mode

I run tmux in VI mode. VI-like navigation in copy-mode works fine. However, I can't select any text. Neither v nor V doesn't switch to VI-like text selecting mode.

What am I missing?

By the way, is it possible to display line numbers in copy-mode?

P.S. if it makes any difference, I'm running tmux on Mac OS w/ ZSH shell


Source: (StackOverflow)

How does the tmux color palette work?

I'm trying to set something to gray, but can't figure out how. The only bit of info in the man page about colors I can find is:

message-bg colour
  Set status line message background colour, where colour is one of:
  black, red, green, yellow, blue, magenta, cyan, white, colour0 to
  colour255 from the 256-colour palette, or default.

I also found a blog post which iterates through colors, but I can't quite grok it, and don't want to sit at the terminal all day guessing color numbers until one works.


Source: (StackOverflow)

How do I reorder tmux windows?

In screen, I can just type C-a :number 0 to move a window to the top of the window list and push all the other windows down one. What's the equivalent command sequence for tmux? I looked at the man page, but I'm finding it confusing on this point.


Source: (StackOverflow)

How can I make tmux use my default shell?

On a new setup, tmux is using bash instead of my default (zsh).

How can I force it to use zsh?


Source: (StackOverflow)

Unable to use pbcopy while in tmux session

Running tmux 1.4 installed from ports on snow-leopard I am unable to use the built in OSX pbcopy command.

Outside of tmux:

> echo "abc" | pbcopy
> echo $(pbpaste) # or using ^v
abc

But inside of tmux:

> echo "123" | pbcopy
> echo $(pbpaste)
abc

I've scoured the man page but can't find any options that might relate to this behaivor. I also can't understand why tmux would mess with shell redirection.

Anybody have any clues?


Source: (StackOverflow)

vim freezes inside tmux

I'm using split panes in tmux - one being vim, other shell. Sometimes, around once a day, vim freezes. I can move between panes, perform any tmux commands, just vim doesn't react to anything. This happens only with tmux. My only solution for now is to kill that pane and create new one.


Source: (StackOverflow)

How to detach a tmux session that itself already in a tmux?

I've opened a tmux session on my local machine, and ssh to the remote machine. After this, I typed command "tmux attach" on the remote machine, then I got a remote tmux session on my local tmux session.
Now I want to detach the remote tmux sesstion, I've tried "C-b d", but it detached my local tmux session rather than the remote one.

How can I detach the remote tmux sesstion?


Source: (StackOverflow)

How to convert 2 horizontal panes to vertical panes in tmux?

After doing join-pane on 2 windows, you have 2 horizontal panes. How do I rearrange the panes to be vertical panes instead?


Source: (StackOverflow)

tmux vs. screen

I'm about to get back into using GNU Screen, but I have been hearing people occasionally mention tmux as a better alternative. Does it really offer an alternative to all the features Screen offers, such as activity monitoring in different windows, etc.? What are the pros and cons of each?


Source: (StackOverflow)

"Maximizing" a pane in tmux

Sometimes it would be very useful to maximize a pane in tmux and then restore it to it's previous size.

I've been reading the manual and I can't find a way. What I've come up with is that I could bind a key to resize the pane to "max" width, and another key to restore it to some predefined width.

Of course this has its drawbacks, so I'm wondering if anyone has a better idea.


Source: (StackOverflow)

How can I make ctrl+left/right keys work right in tmux?

In both zsh and bash, ctrl+arrows allows me to move the position I'm typing at by whole word, but this does not work in tmux, which is a problem as I'm currently launching it automatically every time I open a shell.

How can I fix this?


Source: (StackOverflow)