News for hackers. Stuff that matters.
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