Migrating from screen(1) to tmux(1)?

David Wolfskill david at catwhisker.org
Sun Jun 19 19:57:35 PDT 2011


While I've used screen(1) for some time, my usage of it is fairly simple
-- quite possibly better-characterized as "primitive."

Catalyzed by reports of cleaner code & smaller footprint, to say
nothing of getting rid of the bug/misfeature of screen that causes
displayed mail messages to be artifically padded with trailing
spaces to the end of each line, I thought I might see if tmux(1)
might work as well for my (perceived) needs.

Unfortunately:
* Nearly all I've found i the man page and online has gone on (and ON)
  about interacting with tmux in Neat and Cool ways -- and I Don't Care.

* I don't find a way to perform a Google search in a case-sensitive way
  (let alone in a way that allows the searcher to use something similar to
  regular expressions).

A fairly typical example of my use of screen is for running a
curses-based mail client (mutt(1)).

I do this (for home) on the mail hub machine in my home network.  Thus,
from wherever I am, I establish an ssh connection to the machine in
question, and (currently -- using screen) issue:

	screen -dR mail 2>/dev/null

Naturally, I have a script that handles connecting to the machine,
creating an xterm window, and running the above screeen command.

That particular way of invoking screen -- using -dR flags -- says
"Reattach a session and if necessary detach or  even  create  it first."

Thus, I need not care whether or not such a session exists: if it
doesn't, the above will create it, and in any case, will attach to it.

The nearest approach I've found to thus using tmux is:

	tmux -q attach -dt mail || tmux -q new -s mail

which doesn't work quite so well as (say) the argument to the -e flag in
xterm(1).

Yes, I could create a shell script to do precisely that -- but then I'd
need to ensure that the script is present on the remote machine before I
can use tmux in that way -- which I find to be an annoying restriction.

Does anyone have any suggestions for how to accomplish the "create if
necessary, then attach" function using a single invocation of tmux?

If necessary, I could try hacking the code -- but I'd really rather
avoid re-inventing the wheel.

Thanks!

Peace,
david
-- 
David H. Wolfskill				david at catwhisker.org
Depriving a girl or boy of an opportunity for education is evil.

See http://www.catwhisker.org/~david/publickey.gpg for my public key.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://www.baylisa.org/pipermail/baylisa/attachments/20110619/d692efdf/attachment.bin>


More information about the Baylisa mailing list