LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   `set -x` showing lines from zshrc (https://www.linuxquestions.org/questions/linux-newbie-8/%60set-x%60-showing-lines-from-zshrc-4175678141/)

blueray 07-04-2020 10:53 AM

`set -x` showing lines from zshrc
 
I am using zsh-git-prompt

When I use set -x to debug a command it output some extra lines.

Code:

% 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

What might be causing it?

I have created an issue but I think something is wrong with my configuration. I am saying this because I am also having the same issue with z.plugin.zsh

Do, anyone have any idea regarding this issue?

shruggy 07-04-2020 11:07 AM

See Hook Functions in zshmisc(1). Particularly, zshrc.sh sets chpwd, precmd, and preexec hooks.

blueray 07-05-2020 03:26 AM

I am actually sourcing multiple files to [c].zshrc[/c]. When I use [c]set -x[/c] there is actually at least 200+ lines (not only the lines shown in the question). I did not show the complete picture to keep things simple.

Is there any way I can use the [c]set -x[/c] command so that it will only execute the commands after the prompt.

Or, is there anything I can put in the top of my [c].zshrc[/c] so that it will not be debugged when using [c]set -x[/c].


All times are GMT -5. The time now is 05:41 AM.