From 27b054baa2a78f2629c571ce0c6b9f0d0f22e605 Mon Sep 17 00:00:00 2001 From: Bryan Ramos Date: Thu, 27 Apr 2023 15:32:06 -0400 Subject: [PATCH] fixed ps1? --- homeConfig/dotfiles/bash/bashrc | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/homeConfig/dotfiles/bash/bashrc b/homeConfig/dotfiles/bash/bashrc index 5f80f63..7988379 100644 --- a/homeConfig/dotfiles/bash/bashrc +++ b/homeConfig/dotfiles/bash/bashrc @@ -16,15 +16,18 @@ export EDITOR=nvim } # PS1 Config - if [ -n "${IN_NIX_SHELL:+x}" ]; then - PS1="\[\033[01;34m\]\w\[\033[00m\]\n\[\033[01;32m\]nixShell > \[\033[00m\]" - else - if ! is_ssh_session; then - PS1="\n\[\033[01;34m\]\w\[\033[00m\]\n\[\033[01;32m\]> \[\033[00m\]" + function set_ps1_prompt() { + if [ -n "${IN_NIX_SHELL:+x}" ]; then + PS1="\[\033[01;34m\]\w\[\033[00m\]\n\[\033[01;32m\]nixShell > \[\033[00m\]" else - PS1="\n\[\033[01;34m\]\w\[\033[00m\]\n\[\033[01;32m\]\u@\h:\[\033[00m\] " + if ! is_ssh_session; then + PS1="\n\[\033[01;34m\]\w\[\033[00m\]\n\[\033[01;32m\]> \[\033[00m\]" + else + PS1="\n\[\033[01;34m\]\w\[\033[00m\]\n\[\033[01;32m\]\u@\h:\[\033[00m\] " + fi fi - fi + } + PROMPT_COMMAND="set_ps1_prompt; $PROMPT_COMMAND" # Locate and source the bash-completion scripts bash_completion_dir="$HOME/.nix-profiles/share/bash-completion/completions"