You are not logged in.

#1 2011-05-17 17:23:28

awayand
Member
Registered: 2009-09-25
Posts: 398

[SOLVED] tmux as login shell

Hi,
anyone tried using tmux as login shell? chsh says it is invalid.
I want tmux to attach to an existing session or else create a new one upon login if no session exists.
Putting "exec /usr/bin/tmux attach" into my ~/.bash_profile doesn't create a session if none exists.
Any ideas?
Thanks!

Last edited by awayand (2011-05-17 18:28:50)

Offline

#2 2011-05-17 17:56:23

litemotiv
Forum Fellow
Registered: 2008-08-01
Posts: 5,026

Re: [SOLVED] tmux as login shell

tmux is not a shell itself but a terminal multiplexer; one or more shells are running inside tmux.

You can try something like this in your .bashrc:

if [[ -z "$TMUX" ]]; then
        tmux att 
fi

ᶘ ᵒᴥᵒᶅ

Offline

#3 2011-05-17 18:28:22

awayand
Member
Registered: 2009-09-25
Posts: 398

Re: [SOLVED] tmux as login shell

Although I don't understand what the script does: that worked like a charm. Thanks!

Offline

Board footer

Powered by FluxBB