Bash: prompt for tmux to show MOTD in SSH sessions
This commit is contained in:
parent
396624c6d5
commit
2ef53d351a
@ -29,6 +29,15 @@ popd() {
|
|||||||
cd .
|
cd .
|
||||||
}
|
}
|
||||||
|
|
||||||
if [ -z "$TMUX" ] && [ "$PWD" == ~ ]; then
|
if [ -z "$TMUX" ] && [ -n "$SSH_TTY" ]; then
|
||||||
tmux new -As default
|
tput sc
|
||||||
|
tput smso
|
||||||
|
echo -n 'tmux: space - shell: any key'
|
||||||
|
tput sgr0
|
||||||
|
read -rsN1 input
|
||||||
|
tput rc
|
||||||
|
tput el
|
||||||
|
if [ "$input" = ' ' ]; then
|
||||||
|
tmux new -As default
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user