Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zsh-git-prompt not working nicely with set -x #143

Closed
blueray453 opened this issue Jul 4, 2020 · 2 comments
Closed

zsh-git-prompt not working nicely with set -x #143

blueray453 opened this issue Jul 4, 2020 · 2 comments

Comments

@blueray453
Copy link

blueray453 commented Jul 4, 2020

I have downloaded gitstatus.py and zshrc.sh

sourced zshrc.sh to my .zshrc like . ~/zshfiles/zshrc.sh

The prompt is working nicely.

However, when I use set -x & set +x to debug some command these files also give some output.

% set -x
+precmd_update_git_vars:1> [ -n '' ']'
+precmd_update_git_vars:1> [ '!' -n '' ']'
+precmd_update_git_vars:2> update_current_git_vars
+update_current_git_vars:1> unset __CURRENT_GIT_STATUS
+update_current_git_vars:3> [[ python == python ]]
+update_current_git_vars:4> _GIT_STATUS=+update_current_git_vars:4> python /home/ismail/zshfiles/gitstatus.py
+update_current_git_vars:4> _GIT_STATUS='' 
+update_current_git_vars:6> __CURRENT_GIT_STATUS=( '' ) 
+update_current_git_vars:7> GIT_BRANCH='' 
+update_current_git_vars:8> GIT_AHEAD='' 
+update_current_git_vars:9> GIT_BEHIND='' 
+update_current_git_vars:10> GIT_STAGED='' 
+update_current_git_vars:11> GIT_CONFLICTS='' 
+update_current_git_vars:12> GIT_CHANGED='' 
+update_current_git_vars:13> GIT_UNTRACKED='' 
+precmd_update_git_vars:3> unset __EXECUTED_GIT_COMMAND
% set +x
+preexec_update_git_vars:1> case set +x (git* | hub* | gh* | stg*)
+zsh:2> set +x

What might be the issue here?

@thomasrebele
Copy link

The issue is that set -x activates a mode that logs the commands that the shell executes. That includes unfortunately the commands executed by zsh-git-prompt to generate the prompt. You could disable the git prompt temporarily.

@blueray453
Copy link
Author

Currently I am debugging my script using

bash -xv ./ex.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants