4

I am experience some problem in my zsh configuration which is based on oh-my-zsh, which I have described at Physical buffer in terminal is getting misaligned with display in oh-my-zsh configuration.

What I need to know if there is some kind of logging mode in which zsh can produce some information on what is happening in real-time.

The other thing is a print out of the current configuration that a more knowledgeable person can use to track the problem. By configuration I don't mean the just contents of my profile, but some more runtime state related info that can help the diagnosis.

muru
  • 72,889
vfclists
  • 7,531
  • 14
  • 53
  • 79

1 Answers1

3

You have several options.

First of all, you can setopt xtrace or set -x to get trace info on all calls in the current shell or use zsh -x to start a new shell with that option set. This generates a lot of debug info, though. Plus, it might not even include all the things you are interested in.

If you know more specifically what you are looking for, you can use functions -t <function name> for the specific function that you want to trace.

However, what I find to be the most reliable way to track down problems in any .zshrc config, is to do the following:

cd "$( mktemp -d )"
ZDOTDIR=$PWD HOME=$PWD zsh -df

This creates a temp folder and starts a new subshell without any config files, with its config and home dirs set to the temp folder.

Then you can execute the relevant lines in your .zshrc one by one by pasting them into the sub shell, until you find the point where things start to break.