From: Oleg Broytman Date: Fri, 13 Jan 2023 15:26:25 +0000 (+0300) Subject: .shellrc: Move bash-only code to `.bashrc` X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=37eec285330d0072c8095e64631b4ad8f0c92d26;hp=a76afb2b4578dc34da0abd6d61c54a9345800f5e;p=dotfiles.git .shellrc: Move bash-only code to `.bashrc` --- diff --git a/.bashrc b/.bashrc index 3255cb6..f516a37 100644 --- a/.bashrc +++ b/.bashrc @@ -53,6 +53,14 @@ back() { cd - "$@"; } functions() { typeset -f "$@"; } j() { jobs; } +if [ -r "$HOME"/admin/prog/bash_prompt ]; then + . "$HOME"/admin/prog/bash_prompt + set_prompt + unset set_prompt +else + PS1="${debian_chroot:+($debian_chroot)}\u@\h:\W \$SHLVL\\$ " +fi + if [ -z "$BASH_COMPLETION_COMPAT_DIR" ]; then if [ -d /usr/share/bash-completion -a -r /usr/share/bash-completion/bash_completion ]; then _BASH_COMPLETIONS_DIR=/usr/share/bash-completion/completions diff --git a/.shellrc b/.shellrc index 944d2f6..e3a0ac7 100644 --- a/.shellrc +++ b/.shellrc @@ -44,16 +44,6 @@ if test -n "$KSH_VERSION" -o -n "$FCEDIT"; then j() { jobs; } fi -if test -n "$BASH_VERSION"; then - if [ -r "$HOME"/admin/prog/bash_prompt ]; then - . "$HOME"/admin/prog/bash_prompt - set_prompt - unset set_prompt - else - PS1="${debian_chroot:+($debian_chroot)}\u@\h:\W \$SHLVL\\$ " - fi -fi - # clear screen and history, logout chlo() { clear; cd; >$HISTFILE; unset HISTFILE; history -c; logout || exit; }