News for hackers. Stuff that matters.
Re:Terminology – a new terminal emulator by AceJohnny2 on Monday March 25, 2013 @02:57PM (#5438901)
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.
Re:Terminology – a new terminal emulator by evilduck on Monday March 25, 2013 @04:00PM (#5439348)
I 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.

Re:Terminology – a new terminal emulator by spudlyo on Monday March 25, 2013 @06:15PM (#5440061)
Nesting 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
Re:Terminology – a new terminal emulator by bashinator on Tuesday March 26, 2013 @12:55AM (#5441474)
You 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.
Re:Terminology – a new terminal emulator by philsnow on Monday March 25, 2013 @07:45PM (#5440449)
Nesting 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.

Re:Terminology – a new terminal emulator by maxaf on Monday March 25, 2013 @08:40PM (#5440680)
^Z looks like a great escape sequence. Never thought of this one. ^O is my current favorite, and ^\ isn't far behind.
Re:Terminology – a new terminal emulator by spudlyo on Monday March 25, 2013 @08:52PM (#5440725)
I 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.
Re:Terminology – a new terminal emulator by maxaf on Monday March 25, 2013 @08:54PM (#5440730)
Me, I tend to leak tmux sessions and windows all over the place. It's almost like job control but with a modern twist.
Re:Terminology – a new terminal emulator by bashinator on Tuesday March 26, 2013 @12:56AM (#5441476)
I like ^J myself. Left pinky, right index finger.
Re:Terminology – a new terminal emulator by keeperofdakeys on Monday March 25, 2013 @06:00PM (#5439996)
As 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.
Re:Terminology – a new terminal emulator by jeffcox on Monday March 25, 2013 @05:19PM (#5439765)
I 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.
Re:Terminology – a new terminal emulator by q_revert on Tuesday March 26, 2013 @05:21AM (#5442050)
perhaps 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

Re:Terminology – a new terminal emulator by antihero on Monday March 25, 2013 @06:21PM (#5440090)
Personally 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.

Re:Terminology – a new terminal emulator by onosendai on Monday March 25, 2013 @07:08PM (#5440314)
If you're just using Tmux as a way to split/tab your terminals you're missing out on a ton of its functionality.

For example it also allows you to detach/reattach your running session, which is invaluable if you're working remotely, and especially if you have a flaky connection. I've used it in several instances where there is more than one person handling DB upgrades and the like. You can have several panes/tabs open, vim with upgrade notes, and everyone connecting and working as needed. It beats the crap out of constant copying/pasting pieces of code and terminals on some IM program to make sure everyone sees what you're seeing.

I usually also end up running it locally and bypassing the terminal emulator and WM's multiplexing abilities, but it's more out of a desire to use the same tool whether I'm running locally or on some remote box. If you don't need the latter, it's a bit harder to justify using it, even though it still has some advantages, like generally being more scriptable.

Re:Terminology – a new terminal emulator by graue on Tuesday March 26, 2013 @12:01AM (#5441328)
> it also allows you to detach/reattach your running session

I use dtach(1) for this. I'm sure tmux is far more powerful, but dtach is much simpler and does all I need at this point. It's still less than a year since I learned Vim, so I'm taking a break from learning arcane programs with a zillion options for a while :P

Re:Terminology – a new terminal emulator by antihero on Monday March 25, 2013 @07:43PM (#5440440)
Yeah, tmux remotely is great, but for terminals on the desktop I don't really feel that it's that useful.
Re:Terminology – a new terminal emulator by q_revert on Tuesday March 26, 2013 @05:51AM (#5442135)
locally, I find the tmux buffer system (just like in vim) to be very useful for pasting text around the place, also, the newer versions have :choose-tree, which is well worth a look, using ^a s gives you a list of open sessions, from which you can choose what you were working on, and if you give your sessions sensible names (based on the starting directory for example) then you can switch between projects/jobs incredibly easily..

also, running tmux locally has the advantage that if you need to leave the office or go somewhere, you can still reattach to your work machine and pick up from where you left off.. so, in a sense, everything is remote

Re:Terminology – a new terminal emulator by philsnow on Monday March 25, 2013 @06:44PM (#5440204)
I 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.
Re:Terminology – a new terminal emulator by antihero on Monday March 25, 2013 @07:47PM (#5440452)
I'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.

Re:Terminology – a new terminal emulator by codygman on Monday March 25, 2013 @11:54PM (#5441303)
There 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).
Re:Terminology – a new terminal emulator by philsnow on Tuesday March 26, 2013 @06:41PM (#5446524)
no, 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.

Re:Terminology – a new terminal emulator by banachtarski on Monday March 25, 2013 @06:40PM (#5440180)
Agreed. Multiplexing panes and tabs should be the responsibility of the WM, not the terminal itself.
Re:Terminology – a new terminal emulator by Goranek on Tuesday March 26, 2013 @05:33AM (#5442091)
not when you're working via ssh
Re:Terminology – a new terminal emulator by haraldk on Monday March 25, 2013 @04:37PM (#5439550)
Guys, why don't you just go ahead and get yourself a tiling window manager??

http://awesome.naquadah.org/

Re:Terminology – a new terminal emulator by platz on Monday March 25, 2013 @05:15PM (#5439736)
Or perahps I3!

http://i3wm.org/

Re:Terminology – a new terminal emulator by kostya-kow on Monday March 25, 2013 @06:46PM (#5440208)
Or even better, XMonad!

http://xmonad.org/

Re:Terminology – a new terminal emulator by pekk on Tuesday March 26, 2013 @02:37AM (#5441692)
Only better if you are up for 500mb of dependencies and having to learn Haskell to configure your desktop.
Re:Terminology – a new terminal emulator by nitheshm on Tuesday March 26, 2013 @03:16AM (#5441759)
Configuring XMonad is a very good reason to learn Haskell, among many others.
Re:Terminology – a new terminal emulator by wink on Tuesday March 26, 2013 @04:30AM (#5441899)
And apart from a little arcane syntax, you absolutely don't have to learn any real Haskell to configure xmonad.
Re:Terminology – a new terminal emulator by nedludd on Tuesday March 26, 2013 @08:37AM (#5442780)
No, but you have to learn a REALLY arcane syntax!
Re:Terminology – a new terminal emulator by Goranek on Tuesday March 26, 2013 @05:31AM (#5442081)
or better use DWM :P
Re:Terminology – a new terminal emulator by onedognight on Monday March 25, 2013 @05:01PM (#5439664)
Terminal 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.

Re:Terminology – a new terminal emulator by Aissen on Tuesday March 26, 2013 @05:11AM (#5442027)
The 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.

Re:Terminology – a new terminal emulator by nachteilig on Monday March 25, 2013 @05:16PM (#5439738)
Somehow 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!

Re:Terminology – a new terminal emulator by bierko on Monday March 25, 2013 @04:14PM (#5439431)
For me, tabs distract from the cleanliness of a black (or insert your own background color) terminal.
Re:Terminology – a new terminal emulator by spolu on Monday March 25, 2013 @04:51PM (#5439608)
Fullscreen is important!
Re:Terminology – a new terminal emulator by CJefferson on Monday March 25, 2013 @06:20PM (#5440085)
Personally, 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.

Re:Terminology – a new terminal emulator by RobSis on Monday March 25, 2013 @06:27PM (#5440121)
setw -g mode-mouse on

setw -g mouse-select-window on

setw -g mouse-select-pane on

setw -g mouse-resize-pane on

Re:Terminology – a new terminal emulator by moe on Monday March 25, 2013 @09:58PM (#5440964)
Sadly 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

Re:Terminology – a new terminal emulator by RobSis on Tuesday March 26, 2013 @04:44AM (#5441931)
I wouldn't call the copy-mode "crippled subset of the real thing".

With tmux's copy-mode, you can even select text without touching your mouse, using e.g. vim-like movements. Which is amazing feature.

The fact, that the copy-mode doesn't jump back down with every change on stdout is also very nice feature.

If you want to work with standard linux clipboard, you still can - just hold shift and select like in almost any linux TUI application.

Re:Terminology – a new terminal emulator by CJefferson on Monday March 25, 2013 @06:49PM (#5440230)
Thanks.

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?

Re:Terminology – a new terminal emulator by Goranek on Tuesday March 26, 2013 @05:31AM (#5442082)
i cannot force this to work on urxvt :/
Re:Terminology – a new terminal emulator by RobSis on Tuesday March 26, 2013 @12:11PM (#5444222)
Well, it does work with urxvt. Since you provided nothing about your configuration, I can't tell you what's the problem.
Re:Terminology – a new terminal emulator by columbo on Monday March 25, 2013 @06:09PM (#5440039)
I use tmux daily but I still rely on emulator tabs when tailing verbose files as sending it through tmux will lock up my terminal.
Re:Terminology – a new terminal emulator by RegEx on Monday March 25, 2013 @04:10PM (#5439414)
I like using both. Sometimes a screen tab just isn't enough separation.