Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(scm-prompt): suppress cd output (#985)
Summary: If a user has a `chpwd` hook that prints output, it will be prepended to the `dir` variable which breaks the prompt. This change suppresses the output of `cd` to prevent this. Alternatively I considered doing `cd -q` to skip running the chpwd hook, but decided against it. Pull Request resolved: #985 Test Plan: ```zsh $ zsh --no-rcs $ source ~/workspace/github.com/facebook/sapling/eden/scm/contrib/scm-prompt.sh && _scm_prompt # things should be fine $ say_hi() { echo hello } && chpwd_functions+=(say_hi) && _scm_prompt ``` prior to this commit, the prompt would be broken. After this commit, it should be fine. Background: in my particular case, I have a `chpwd` hook that [sources custom scripts](https://github.com/vegerot/dotfiles/blob/032f88715fa2911bec6b3c09aa012145bb1dae7e/.zshrc#L250-L252) depending on the directory, and will tell me if it does so. This was breaking the prompt, so I added this change to fix it. Reviewed By: quark-zju Differential Revision: D66384725 fbshipit-source-id: e03d18887a27fc6c55da1dc7347eacf0fa38cde7
- Loading branch information