Hygo AI custom shell.
the crackhead ai made some weird stuff work
1 file changed, +3 -6
+3-6setup.sh
| @@ -9,11 +9,8 @@ fi | ||
| 9 | 9 | cd $CURRENT_DIR |
| 10 | 10 | |
| 11 | 11 | # Function to get the current Git branch |
| 12 | -git_branch_str() { | |
| 13 | - git_branch=$(git branch 2>/dev/null | grep '*' | sed 's/* //') | |
| 14 | - if [ -n "$git_branch" ]; then | |
| 15 | - echo -e "($git_branch)" | |
| 16 | - fi | |
| 12 | +get_git_branch() { | |
| 13 | + git branch 2>/dev/null | grep '*' | sed 's/* //' | |
| 17 | 14 | } |
| 18 | 15 | |
| 19 | 16 | # Set up zsh prompt |
| @@ -23,5 +20,5 @@ fi | ||
| 23 | 20 | |
| 24 | 21 | # Set up bash prompt |
| 25 | 22 | if [ -n "$BASH_VERSION" ]; then |
| 26 | - PS1="\[\e[38;5;214m\]\u@\h \w $(git_branch_str)\n\$\[\e[0m\] " | |
| 23 | + PS1='\[\e[38;5;214m\]\u@\h \w$(git_branch=$(get_git_branch); if [ -n "$git_branch" ]; then echo " \[\e[37m\]($git_branch\[\e[0m\])"; fi)\n\$\[\e[0m\] ' | |
| 27 | 24 | fi |