8

I'm considering switching from screen to tmux, but I've invested lots of time developing an extensive .screenrc, and I don't want to find after many hours of porting it to tmux that tmux can't do something that is important to me.

I've looked at several online comparisons of the two, and none of them go into much depth or answer many of (what are to me) the important questions, which can be boiled down to two questions:

  • Is there anything significant that screen can do that tmux can't do?
  • Is there anything significant that tmux can do that screen can't?

(The client-server architecture is nice, but doesn't give any new capabilities as far as I can see. The license is obviously better. Smaller and leaner is obviously nice, but not a game changer for me.)

Since these 2 questions are very broad, let me give some specific examples:

  • Does tmux have a complete command history? (For commands sent to tmux itself, not shell commands. This is something that screen is missing: How can I go back in the (GNU) screen command history? (NOT shell command history!))
  • I assume I can bind keys to tmux commands?
  • I assume my tmux configuration file can source other files?
  • Can I bind a keystroke to the source command, so that I can dynamically change my configuration easily?
  • Does tmux have ACL settings? (I've never actually needed these in screen, but it's nice to know they're there.)
  • Can tmux open default windows? (a la screen -t somename 1 ssh someserver)

I could hunt down answers to these specific questions myself, but they're just examples of the 2 bigger questions, and I'd also like to hear answers to the bigger questions that don't necessarily fit any of my examples. It's entirely possible that if there's something missing from tmux I wouldn't discover it after spending lots of time switching, and that's what I want to avoid. Thanks!

2 Answers 2

2

I don't know the answer to all your questions off hand, but I'll do what I can.

The biggest for me is in gnu-screen, splitting splits your view so you can view different screens (e.g., screen 1 & 2, or even screen 1 & 1). In tmux, splitting splits the screen itself, so I can have screen 1 & 2, but screen 1 has 4 splits (4 different terminals). You cannot do this in gnu-screen without patches.

You can definitely bind keys to tmux commands. When I switched from gnu-screen to tmux, I rebound what I needed for it to be more screen-like, e.g.,

set -g prefix C-a 
setw -g mode-keys vi
unbind C-b 
bind a send-prefix
bind v split-window -v
bind h split-window -h
bind S split-window
bind Escape copy-mode
bind C-a last-window
bind C-d detach
bind A command-prompt "rename-window %%"

tmux can also open default windows using tmux.conf, like so:

new -d -n "window1"
neww -d -n "window2"
neww -d -n "window3"

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .