diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2020-12-17 15:18:16 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2020-12-17 15:18:16 +0300 |
commit | bf199c0371d2f4a26b807dc02b678cbafd33758c (patch) | |
tree | a6d9c5a8a8b0b4d08dfbd22df5fd964eafa615eb | |
parent | nnn: don't show dotfiles by default (diff) | |
download | linux-home-bf199c0371d2f4a26b807dc02b678cbafd33758c.tar.gz linux-home-bf199c0371d2f4a26b807dc02b678cbafd33758c.zip |
tmux: start automatically
-rw-r--r-- | %HOME%/.bashrc | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/%HOME%/.bashrc b/%HOME%/.bashrc index 8264895..5a0ee57 100644 --- a/%HOME%/.bashrc +++ b/%HOME%/.bashrc @@ -100,13 +100,13 @@ os_is_cygwin \ || command -v stty > /dev/null 2>&1 \ && stty -ixon -# Hopefully, this Tilix warning is really important: +# Tilix: fix the important warning. # https://gnunn1.github.io/tilix-web/manual/vteconfig/ if [ "$TILIX_ID" ] || [ "$VTE_VERSION" ]; then [ -r /etc/profile.d/vte.sh ] && source /etc/profile.d/vte.sh fi -# Prevent nested ranger instances. +# ranger: prevent nested instances. ranger() { if [ -z "$RANGER_LEVEL" ]; then /usr/bin/ranger "$@" @@ -115,12 +115,10 @@ ranger() { fi } -# nnn - -# The selected paths. +# nnn: print selected paths. alias ncp="cat ${NNN_SEL:-${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.selection} | tr '\0' '\n'" -# Like quitcd.bash_zsh, but better. +# nnn: like quitcd.bash_zsh, but better. n() { [ -n "$NNNLVL" ] && [ "${NNNLVL:-0}" -ge 1 ] && exit @@ -137,3 +135,9 @@ n() { nnn() { n "$@" } + +# tmux: start automatically. +# https://unix.stackexchange.com/a/113768 +if command -v tmux &> /dev/null && [ -n "$PS1" ] && [[ ! "$TERM" =~ screen ]] && [[ ! "$TERM" =~ tmux ]] && [ -z "$TMUX" ]; then + exec tmux new-session -A -s main +fi |