6 ms·
I used to care a lot about tabs and pane splitting in the terminal emulator. Then I discovered terminal multiplexers: screen, then tmux. Now I don't want those
by AceJohnny2 14y ago
I used to care a lot about tabs and pane splitting in the terminal emulator. Then I discovered terminal multiplexers: screen, then tmux. Now I don't want those features in the terminal emulator anymore, as they overlap and even conflict with the terminal multiplexer.
- evilduck 14y agoI still like tabs. I'm often logged into multiple remote machines where, for me, a terminal emulator's tab represents a unique SSH connection and that tab then has tmux running on the remote machine. Otherwise, I'd be running tmux on my local machine, then want to run tmux on a remote machine, and nesting terminal multiplexers is not good.
- jeffcox 14y agoI think that's a big differentiator in people's CLI preferences. When I see prompts that don't include $HOSTNAME, and people eschewing tabs for multiplexing in all cases I just assume they rarely manage remote machines.
- q_revert 14y agoperhaps it's not that they don't manage remote machines, just that they do it differently to you.. nested tmux with $HOSTNAME/$IP in the hardstatus make this very easy imo, tells you where you are whilst also allowing you to keep a minimal prompt.. as i find long prompts can be incredibly annoying also, using ^a^a to send commands to the nested tmux isn't so bad.. but to get to the third one down you need to use ^a^a^a^a as you need to send a ^a^a to the second one in.. for the fourth nest you need 8 ^a's, but again, it's a bit like code indentation, if you're 4 tmuxes deep, then there's a good chance you're doing it wrong but still, it's nice to be able to do it if necessary
- keeperofdakeys 14y agoAs long as you keep a proper frame of reference, you'll be fine (I disable tmux's status bar on nested tmux sessions though). You can use C-a a, or something similar to send a C-a to the nested session, although it can be a little annoying.
- spudlyo 14y agoNesting terminal multiplexers is very good, I do it for exactly the use case you mentioned. Escaping your escape key is easy, with a little practice you won't even realize you're doing it. I have a shell function called 'go' that creates a new screen and labels it, connects to the remote host via SSH, and then recreates or re-attaches to the remote scren as appropriate. My top level screen session currently has 8 remote hosts I'm logged into, each running their own nested screen sessions. My go() function also reads my ~/.ssh/config file to grab all my host aliases so I can tab complete to them. Note, I'm a Perl programmer, and rarely write shell scripts, so this function may be kinda ugly. go() { local OPTIND OPTARG local SCREENCMD="screen -dRR" while getopts "xn" flag; do case "$flag" in x) SCREENCMD="screen -xRR"; shift;; n) SCREENCMD=""; shift;; esac done if [ "$#" == "0" ]; then echo "Need someplace to go." return 1; fi while (( "$#" )); do screen -t $1 ssh -tq $1 $SCREENCMD shift done } _go_show() { local curr opts cur="${COMP_WORDS[COMP_CWORD]}" opts=$(grep 'Host ' ~/.ssh/config | cut -d' ' -f2) COMPREPLY=( $(compgen -W "${opts}" ${cur}) ) } complete -F _go_show go
- bashinator 14y agoYou should know that the bash-completion package in Debian and kin does tab-expansion of ssh hosts in known_hosts and config. Also handles the --argument switches for just about all common utilities.
- philsnow 14y agoNesting terminal multiplexers is wonderful :) It kind of sucks if you accidentally use a hardstatusline in both the nesting and the nested muxes, and it slightly sucks if you use the same escape key for both/all levels of nesting. I have been using a nested screen setup for ~3 years at home and it's great. My outer screen uses ^Z as its escape key (I ^Z very few commands) and the inner ones use ^O. It works wonderfully, and I never have a problem remembering which screen has what because of the different escape keys. It's sort of like the finger memory that you develop if you use multiple workspaces (esp in a WM that supports tagging windows) and always keep the same things on the same workspaces.
- maxaf 14y ago^Z looks like a great escape sequence. Never thought of this one. ^O is my current favorite, and ^\ isn't far behind.
- spudlyo 14y agoI use job control pretty often, so ^Z is out for me. I use ^O as my screen escape key, which back in the way old days used to flush output, which was extremely handy at 300 baud.
- maxaf 14y agoMe, I tend to leak tmux sessions and windows all over the place. It's almost like job control but with a modern twist.
- bashinator 14y agoI like ^J myself. Left pinky, right index finger.
- RegEx 14y agoI like using both. Sometimes a screen tab just isn't enough separation.
- bierko 14y agoFor me, tabs distract from the cleanliness of a black (or insert your own background color) terminal.
- spolu 14y agoFullscreen is important!
- haraldk 14y agoGuys, why don't you just go ahead and get yourself a tiling window manager?? http://awesome.naquadah.org/ http://awesome.naquadah.org/
- platz 14y agoOr perahps I3! http://i3wm.org/ http://i3wm.org/
- kostya-kow 14y agoOr even better, XMonad! http://xmonad.org/ http://xmonad.org/
- onedognight 14y agoTerminal multiplexers (screen/tmux/dtach) and native terminal emulators each provide unique features, so for me the best is a combination of both! If you use a mac, I encourage you to try iTerm2/tmux-git. The combination allows you to reconnect to a remote tmux session and get a window with all of your tabs for that server. You'll never need to know the tmux commands again. You'll just use your native commands to switch tabs, search the history, see the list of open tabs, open new tabs, etc. This is the killer setup.
- nachteilig 14y agoSomehow I wasn't previously familiar with tmux, and that looks _fantastic_. I've been stacking screen sessions for years, so this is really exciting. Thanks!
- columbo 14y agoI use tmux daily but I still rely on emulator tabs when tailing verbose files as sending it through tmux will lock up my terminal.
- CJefferson 14y agoPersonally, I really like to be able to drag the splits between terminals, use my scroll wheel, and click between tabs. Maybe these things can be enabled in tmux somehow? I know on a mac tmux/iTerm can do these things, but I'm on linux.
- RobSis 14y agosetw -g mode-mouse on setw -g mouse-select-window on setw -g mouse-select-pane on setw -g mouse-resize-pane on
- CJefferson 14y agoThanks. On a random note, why do all unix applications (generalising I know) seem to default to a super-minimal set of options? Surely the kind of people who get annoyed by mouse integration (and you can just ignore it) are the kind of people who can find out how to turn it on, whereas those of us who are using tmux for the first time want all the nice options turned on by default?
- natermer 14y agobecause people want to be able to use whatever terminal program with the terminal of their choice, even if their choices are wrong and/or insane. Although thank goodness for HN. Now I am aware of tmux mouse-mode and this makes things glorious. Now I just need to figure out a slick way to take the tmux selection and connect it to X's primary clipboard and I will be happy.
- moe 14y agoSadly this still leaves you with a rather crippled subset of the real thing. I.e. "copy mode" instead of proper scrolling, no native text selection, and very noticeable latency and glitches. It's the price you pay for emulating a 35 years old piece of hardware[1] inside an emulator of the same... [1] http://en.wikipedia.org/wiki/VT100 http://en.wikipedia.org/wiki/VT100
- 14y ago
- antihero 14y agoPersonally I've moved from tmux to a tiling window manager with urxvtd. Less fiddly day-to-day and doesn't get locked up and horrible. Tabbing and whatnot are something the WM (in my case, i3) handle far better than a specific program.
- banachtarski 14y agoAgreed. Multiplexing panes and tabs should be the responsibility of the WM, not the terminal itself.
- Goranek 14y agonot when you're working via ssh
- philsnow 14y agoI gave up on urxvtcd when I realized that a single crash brings down all your terminals. Nowadays I use stock xterm, since while I was dallying with urxvt, xterm got the one feature I cared about from urxvt, which was URGENT-on-bell.
- antihero 14y agoI'm not sure how to port color/font config from my urxvt config to xterm. Googling only seems to tell me to how to change background/foreground, not the individual colours. Also, Is there any reason not to use just urxvt (without the client/daemon setup)? I've never had a crash that has brought down all of my clients, however.
- codygman 14y agoThere is no reason not to use urxvt in the normal mode, as it behaves just like xterm would (not exactly of course, but one crashing won't lose all of them).
- philsnow 14y agono, no reason not to use plain urxvt without the client/daemon bit. at the time, I think I was on some kind of network where urxvt's terminfo wasn't likely to be installed anywhere. I know I could install it everywhere in ~/.terminfo or whatever, but it was a pain to get to a new host and realize that I hadn't set it up. I went back to xterm.
- Aissen 14y agoThe nice thing is that Terminology allows you to support any use case you want: - Multi-plexing in the terminal - screen/tmux - multi-plexing in the WM And it's pretty nice ! Written by hackers, for hackers.