ps1 change

This commit is contained in:
Bryan Ramos 2024-10-01 17:12:32 -04:00
parent 5effdcc73b
commit 7e4d44f070
Signed by: bryan
GPG key ID: 6ABDCD144D6643C8

View file

@ -9,12 +9,13 @@ in
'' ''
check_ssh() { check_ssh() {
if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then
ssh_PS1="\n\[\033[01;37m\]\u@\h:\[\033[00m\]" ssh_PS1="\n\[\033[01;37m\]\u@\h:\[\033[00m\]\n"
return 0 return 0
fi fi
} }
${optionalString git.enable '' ${optionalString git.enable ''
check_venv() {
add_icon() { add_icon() {
local icon=$1 local icon=$1
if [[ ! $venv_icons =~ $icon ]]; then if [[ ! $venv_icons =~ $icon ]]; then
@ -44,7 +45,6 @@ python_icon="\[\033[01;33m\]$py\[\033[00m\]"
node_icon="\[\033[01;93m\]$js\[\033[00m\]" node_icon="\[\033[01;93m\]$js\[\033[00m\]"
nix_icon="\[\033[01;34m\]$nix\[\033[00m\]" nix_icon="\[\033[01;34m\]$nix\[\033[00m\]"
check_venv() {
if [ -n "$IN_NIX_SHELL" ]; then if [ -n "$IN_NIX_SHELL" ]; then
add_icon "$nix_icon" add_icon "$nix_icon"
else else
@ -125,6 +125,7 @@ check_project() {
fi fi
} }
''} ''}
function set_prompt() { function set_prompt() {
local green_arrow="\[\033[01;32m\]>> " local green_arrow="\[\033[01;32m\]>> "
local white_text="\[\033[00m\]" local white_text="\[\033[00m\]"
@ -143,9 +144,9 @@ function set_prompt() {
${if git.enable ${if git.enable
then then
''PS1="$ssh_PS1\n$working_dir\n$venv_icons$green_arrow$git_branch_PS1$white_text"'' ''PS1="$ssh_PS1$working_dir\n$venv_icons$green_arrow$git_branch_PS1$white_text"''
else else
''PS1="$ssh_PS1\n$working_dir\n$green_arrow$white_text"'' ''PS1="$ssh_PS1$working_dir\n$green_arrow$white_text"''
} }
return 0 return 0
} }