19 comments

[ 2.9 ms ] story [ 53.7 ms ] thread
As much as I like its functionality, the tmux program ux is terribly unintuitive. From the crash course:

  tmux new -s session_name
    creates a new tmux session named session_name
  tmux attach -t session_name
    attaches to an existing tmux session named session_name
  tmux switch -t session_name
    switches to an existing session named session_name
  tmux list-sessions
    lists existing tmux sessions
  tmux detach (prefix + d)
    detach the currently attached session 
The -s/-t feel like they should not be required. They shouldn't even be different in the first place. list-sessions should just be list, since the -sessions is implicit in all other commands as well. Exiting from a session (ctrl+b d) is another new thing too. If that were at least like vim (which is terrible as well, but esc :q), it would be much easier to interact with. Only after reading the man pages these make sense.
To be fair, "d" is a mnemonic for "detach".
> If that were at least like vim (which is terrible as well, but esc :q), it would be much easier to interact with.

How would you do "esc :q" if you were using vim inside tmux? :)

> Exiting from a session (ctrl+b d) is another new thing too. If that were at least like vim (which is terrible as well, but esc :q), it would be much easier to interact with.

I'm afraid I don't understand your point. What is the issue with detach? You want an non controlled escape key press to be your command trigger? How does that make any sense?

I agree with you in principle, and feel like tmux was written "for programmers" and therefore the author(s) felt it more important to be consistent than usable. For instance: I'm pretty sure with `tmux list-sessions` because the command inside tmux is `:list-sessions`.

It wouldn't be terribly hard to write a wrapper for the command itself that works the way you want it to. As simple as it seems, I think that would probably be something useful to create and release.

Not so much for programmers, but I think certainly for people used to the terminal. If you know how to use the shell or a sophisticated editor like vi or emacs, tmux should not be a particular challenge. The target audience is not Unix beginners.
I've used tmux on a daily basis for about four years and have no idea what -t or -s do. My workflow is from a single machine, where I don't need to have multiple sessions - just different windows. For any remote sessions, I just use screen. Doing so has the added benefit of not conflicting with others' workflows, which are likely screen-bound.

tmux's defaults are pretty much universally thought of as awful. Change ctrl-b fo ctrl-a and find some plugins that you like. Also, consider swapping Ctrl and capslock!

My conf: https://github.com/red-bin/dotfiles/blob/master/tmux.conf

Actually I use it in place of screen. I always thought of it as "a better screen"
It definitely is! Though, I've found not enough people know it well enough to make it useful in any distubutrd environment, since it just confuses everyone who's already used screen. And it gets worse because everyone who knows tmux has their own config and workflows. So it's kind of a lose-lose.

Screen also has some much better defaults.

It isn't really implicit, it is just a shorthand, new is short for new-session and attach for attach-session. The alias for list-sessions is "ls" not "list".

I don't know why you would say -s shouldn't be required. Are you suggesting that "tmux new -sname command" should be something like "tmux new -ccommand name" instead?

The intent of -t is that it works much the same for all commands.

Of course you need to read the manual for anything more than the very basics, but tmux is hardly unique in that. Vim is hardly intuitive in any way.

To be fair most tmux use cases are:

ssh -> tmux -> start something -> ctrl-b d -> logout

and maybe later:

ssh -> tmux a

to check the status.

Not sure. I have seen people having two windows: 1. Vim 2. Terminal for compiling

I found it quite handy, then I discovered Emacs :-) We could stay on the subject for years I reckon.

For those who haven't used it--

TMUX is awesome!

Give it a try. You'll be glad you did.

(comment deleted)
I always start tmux using in a shell function like this

    tms () {
          session_name="${1:-sean}" 
          tmux new-session -A -s "${session_name}"
    }
What that does is create a new session or attach to one if it exists. This makes it really easy to detach a session or to log into the same session in multiple windows or whatever.

I can pass a name for the session but if I don't it defaults to my name (so when I'm on a multi-user box my session doesn't clash with other people's). This makes it easy to have separate "work" and "personal" sessions or whatever.

I think for "tmux new-session -A" to work you need a reasonably recent tmux but anything from the last couple of years or so should work.

I use tmux in combination with Mosh because the latter doesn't have an usable "scrollback". Or when I need to keep a session running. ^__^;

Sometime I mangle the status line after a copy/paste operation but I haven't investigated why it happens, my only gripe is that I always forget to press Shift before using the mouse when selecting text.

How do I efficiently copy text in tmux in multi-column mode?! Selecting with mouse grabs the pipe characters and text from other columns, arghh!