lyze / posh-git-sh

Bash/ZSH version of the posh-git command prompt
GNU General Public License v3.0
382 stars 102 forks source link

Bash 5 warning: ignored null byte in input #42

Closed jlucktay closed 1 year ago

jlucktay commented 4 years ago

I have a Bash warning popping up, but only when my working directory is inside a git repo that is checked out to a specific version tag:

bash: warning: command substitution: ignored null byte in input

To reproduce, it would go something like this in an empty directory:

git init
echo "hello world" > foo.txt
git add .
git commit --message "foo bar"
git tag v1.2.3
git checkout v1.2.3

After that, every time you press Enter and get a new prompt, the warning will show.

The warning shows up even with an extremely basic prompt configured, such as: PROMPT_COMMAND='__posh_git_ps1 "hello " "\nworld \\$ "'

I have $BASH_VERSION 5.0.11(1)-release and git is 2.24.0

lyze commented 4 years ago

This would make sense. We use -z and other similar flags throughout for parsing. It may be possible to eliminate most of them or clean them up.