ohmybash / oh-my-bash

A delightful community-driven framework for managing your bash configuration, and an auto-update tool so that makes it easy to keep up with the latest updates from the community.
https://ohmybash.github.io
MIT License
5.54k stars 626 forks source link

Anyon with the same error? Theme sexy #512

Closed cbxcvl closed 6 months ago

cbxcvl commented 6 months ago

bash: command substitution: line 1: syntax error near unexpected token )' bash: command substitution: line 1:[[ -n $(_omb_prompt_git branch 2> /dev/null) ]] && echo " on ")' bash: command substitution: line 1: syntax error near unexpected token )' bash: command substitution: line 1:parse_git_branch)' $

cbxcvl commented 6 months ago

I found a fix

replace the original PS1 line with the following code:


local git_branch
git_branch=$(parse_git_branch)
local git_info
[[ -n $(_omb_prompt_git branch 2> /dev/null) ]] && git_info=" on "
PS1="$python_venv${MAGENTA}\u ${WHITE}at ${ORANGE}\h ${WHITE}in ${GREEN}\w${WHITE}${git_info}${PURPLE}${git_branch}${WHITE}\n\$ ${RESET}"
akinomyoga commented 6 months ago

We received similar reports from users of Git for Windows. Bash distributed with old versions of Git for Windows seems to have a bug (cf https://github.com/ohmybash/oh-my-bash/issues/211#issuecomment-1218903376).

If you use Git for Windows, what is the version of Git for Windows in your system? You can update Git for Windows to the latest version:

$ git update-git-for-windows