From b7129198ebc0c413dbe97aef6076e8d2450fd75b Mon Sep 17 00:00:00 2001 From: DuckDuckWhale Date: Fri, 4 Nov 2022 20:55:43 -0700 Subject: [PATCH] Fix: .local/bin and cargo not loaded in SSH tmux --- auto/bash/.bashrc.append | 44 ---------------------------------- auto/bash/bash.sh | 51 +++++++++++++++++++++++++++++++++++++++- 2 files changed, 50 insertions(+), 45 deletions(-) delete mode 100644 auto/bash/.bashrc.append diff --git a/auto/bash/.bashrc.append b/auto/bash/.bashrc.append deleted file mode 100644 index bd83607..0000000 --- a/auto/bash/.bashrc.append +++ /dev/null @@ -1,44 +0,0 @@ - -# custom - -umask 007 - -export EDITOR='vim' -export VISUAL='vim' -export GPG_TTY=$(tty) - -# cool colored command prompt - -PS1='${debian_chroot:+($debian_chroot)}\[\e[01;38;5;11m\]\u\[\e[00;38;5;208m\]@\[\e[01;38;5;27m\]\h\[\e[00m\]:\[\e[00;38;5;45m\]\w\[\e[0m\]\$ ' -PROMPT_DIRTRIM=3 - -alias ls='ls --color' - -# Shows a oneline preview of all files under the folder after changing directory. - -cd() { - builtin cd "$@" && ls -v -w $COLUMNS --color=always --format=commas --group-directories-first | head -n 1 -} - -pushd() { - builtin pushd "$@" - cd . -} - -popd() { - builtin popd "$@" - cd . -} - -if [ -z "$TMUX" ] && [ -n "$SSH_TTY" ]; then - 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 diff --git a/auto/bash/bash.sh b/auto/bash/bash.sh index 0b2eac6..e02595e 100755 --- a/auto/bash/bash.sh +++ b/auto/bash/bash.sh @@ -1,2 +1,51 @@ #!/bin/sh -cat .bashrc.append >> ~/.bashrc +cat >> ~/.bashrc << 'EOF' + +# custom + +umask 007 + +export EDITOR='vim' +export VISUAL='vim' +export GPG_TTY=$(tty) + +# cool colored command prompt + +PS1='${debian_chroot:+($debian_chroot)}\[\e[01;38;5;11m\]\u\[\e[00;38;5;208m\]@\[\e[01;38;5;27m\]\h\[\e[00m\]:\[\e[00;38;5;45m\]\w\[\e[0m\]\$ ' +PROMPT_DIRTRIM=3 + +alias ls='ls --color' + +# Shows a oneline preview of all files under the folder after changing directory. + +cd() { + builtin cd "$@" && ls -v -w $COLUMNS --color=always --format=commas --group-directories-first | head -n 1 +} + +pushd() { + builtin pushd "$@" + cd . +} + +popd() { + builtin popd "$@" + cd . +} +EOF +cat >> ~/.profile << 'EOF' + +# custom + +if [ -z "$TMUX" ] && [ -n "$SSH_TTY" ]; then + 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 +EOF