admin管理员组文章数量:1303397
I am using git bash terminal in vscode for a git repository and the terminal unexpectedly shut off during a process. (I was installing packages from a requirements file and I am thinking my internet connection broke during that time.) Now whenever I open the terminal, it shows the following error:
bash: warning: command substitution: ignored null byte in input
.
Also, the default location at which git bash opens is not the repo root (C:/git/rep_root (main)
, which used to be the case earlier) but something like as follows:
C:/.../AppData/Local/Programs/Microsoft VS Code (main)
If I open any other terminal like cmd or powershell, there are no annoying warnings and they still open at the repo root.
I am not sure what happened to cause the annoying warning and change the default location of git bash terminal.
What should I do to fix this? I am on git version 2.47.1.windows.2
. I am suspecting it is something to do with git bash within vscode but I am not sure what to do.
EDIT 1: After running the following command PS4=':$BASH_SOURCE:$LINENO+' bash -xli
, after the last successful return statement, here is the output:
::C:/Program Files/Git/mingw64/share/git/completion/git-prompt.sh:24+return 1
::C:/Program Files/Git/mingw64/share/git/completion/git-prompt.sh:128+'[' -f 'C:/projectfolder/repo_root/.git/BISECT_LOG' ']'
::C:/Program Files/Git/mingw64/share/git/completion/git-prompt.sh:132+'[' -n '' ']'
::C:/Program Files/Git/mingw64/share/git/completion/git-prompt.sh:134+'[' -h 'C:/projectfolder/repo_root/.git/HEAD' ']'
::C:/Program Files/Git/mingw64/share/git/completion/git-prompt.sh:138+local head=
::C:/Program Files/Git/mingw64/share/git/completion/git-prompt.sh:544+case "$ref_format" in
::C:/Program Files/Git/mingw64/share/git/completion/git-prompt.sh:142+__git_eread 'C:/projectfolder/repo_root/.git/HEAD' head
::C:/Program Files/Git/mingw64/share/git/completion/git-prompt.sh:2+test -r 'C:/projectfolder/repo_root/.git/HEAD'
::C:/Program Files/Git/mingw64/share/git/completion/git-prompt.sh:2+IFS='
'
::C:/Program Files/Git/mingw64/share/git/completion/git-prompt.sh:2+read -r head
::C:/Program Files/Git/mingw64/share/git/completion/git-prompt.sh:550+case $head in
::C:/Program Files/Git/mingw64/share/git/completion/git-prompt.sh:148+head=refs/heads/main
::C:/Program Files/Git/mingw64/share/git/completion/git-prompt.sh:159+test -z refs/heads/main
::C:/Program Files/Git/mingw64/share/git/completion/git-prompt.sh:178+b=refs/heads/main
::C:/Program Files/Git/mingw64/share/git/completion/git-prompt.sh:183+'[' -n '' ']'
::C:/Program Files/Git/mingw64/share/git/completion/git-prompt.sh:187+local conflict=
::C:/Program Files/Git/mingw64/share/git/completion/git-prompt.sh:188+'[' '' = yes ']'
::C:/Program Files/Git/mingw64/share/git/completion/git-prompt.sh:193+local w=
::C:/Program Files/Git/mingw64/share/git/completion/git-prompt.sh:194+local i=
::C:/Program Files/Git/mingw64/share/git/completion/git-prompt.sh:195+local s=
::C:/Program Files/Git/mingw64/share/git/completion/git-prompt.sh:196+local u=
::C:/Program Files/Git/mingw64/share/git/completion/git-prompt.sh:197+local h=
::C:/Program Files/Git/mingw64/share/git/completion/git-prompt.sh:198+local c=
::C:/Program Files/Git/mingw64/share/git/completion/git-prompt.sh:199+local p=
::C:/Program Files/Git/mingw64/share/git/completion/git-prompt.sh:200+local upstream=
::C:/Program Files/Git/mingw64/share/git/completion/git-prompt.sh:202+'[' true = false ']'
::C:/Program Files/Git/mingw64/share/git/completion/git-prompt.sh:208+'[' true = true ']'
::C:/Program Files/Git/mingw64/share/git/completion/git-prompt.sh:209+'[' -n '' ']'
::C:/Program Files/Git/mingw64/share/git/completion/git-prompt.sh:218+'[' -n '' ']'
::C:/Program Files/Git/mingw64/share/git/completion/git-prompt.sh:224+'[' -n '' ']'
::C:/Program Files/Git/mingw64/share/git/completion/git-prompt.sh:231+'[' -n '' ']'
::C:/Program Files/Git/mingw64/share/git/completion/git-prompt.sh:236+'[' -n '' ']'
::C:/Program Files/Git/mingw64/share/git/completion/git-prompt.sh:241+local 'z= '
::C:/Program Files/Git/mingw64/share/git/completion/git-prompt.sh:243+b=main
::C:/Program Files/Git/mingw64/share/git/completion/git-prompt.sh:244+'[' no = yes ']'
::C:/Program Files/Git/mingw64/share/git/completion/git-prompt.sh:249+'[' -n '' ']'
::C:/Program Files/Git/mingw64/share/git/completion/git-prompt.sh:253+local f=
::C:/Program Files/Git/mingw64/share/git/completion/git-prompt.sh:254+local gitstring=main
::C:/Program Files/Git/mingw64/share/git/completion/git-prompt.sh:256+'[' no = yes ']'
::C:/Program Files/Git/mingw64/share/git/completion/git-prompt.sh:264+printf -- ' (%s)' main
::C:/Program Files/Git/mingw64/share/git/completion/git-prompt.sh:267+return 0
EDIT2: Interestingly, this warning seems to be intertwined with .venv
created through ctrl+shift+P
> Python:Create Environment
in VScode. Any repo where a .venv
is created, git bash terminal starts throwing this warning on startup and otherwise, git bash doesn't throw any warning. I am not sure if git bash executes something related to .venv
on startup and not sure how to ascertain that.
本文标签:
版权声明:本文标题:How to handle `bash: warning: command substitution: ignored null byte in input` in VS Code git bash terminal? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741752620a2395924.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论