sindresorhus / pure

Pretty, minimal and fast ZSH prompt
MIT License
13.22k stars 978 forks source link

81dd496eb380aa051494f93fd99322ec796ec4c2 breaks stderr after exiting subshell #550

Closed nathanchance closed 4 years ago

nathanchance commented 4 years ago

System report (output of prompt_pure_system_report):

- Zsh: zsh 5.8 (x86_64-pc-linux-gnu) (/home/nathan/usr/bin/zsh)
- Operating system: Linux (#1 SMP Sun Jun 21 12:31:14 MST 2020)
- Terminal program: unknown (unknown)
- Tmux: yes
- Git: git version 2.27.0
- Pure state:
    - username: `''`
    - prompt: `❯`
    - version: `1.11.0`
- PROMPT: `typeset -g PROMPT=$'%F{${prompt_pure_colors[path]}}%~%f %F{242}${prompt_pure_vcs_info[branch]}%F{218}${prompt_pure_git_dirty}%f
%{
%}%(12V.%F{$prompt_pure_colors[virtualenv]}%12v%f .)%(?.%F{$prompt_pure_colors[prompt:success]}.%F{$prompt_pure_colors[prompt:error]})${prompt_pure_state[prompt]}%f '`
- Colors: `typeset -g -A prompt_pure_colors=( [execution_time]=yellow [git:action]=yellow [git:arrow]=cyan [git:branch]=242 [git:branch:cached]=red [git:dirty]=218 [git:stash]=cyan [host]=242 [path]=blue [prompt:continuation]=242 [prompt:error]=red [prompt:success]=magenta [user]=242 [user:root]=default [virtualenv]=242 )`
- Virtualenv: `export VIRTUAL_ENV_DISABLE_PROMPT=12`
- Conda: `export CONDA_CHANGEPS1=no`
- Detected frameworks: None

I have:

Problem description

81dd496eb380aa051494f93fd99322ec796ec4c2 breaks stderr after exiting a subshell. I use this all over my place in my dotfiles so I can have self contained functions and it has destroyed my workflow (as I no longer see errors about undefined functions or incorrect commands).

Before:

image

After:

image

Reproduction steps

$ echo "test" > /dev/stderr

$ (exit)

$ echo "test" > /dev/stderr

My .zshrc:

fpath+=(~/.zfunctions)
autoload -U promptinit
promptinit
prompt pure
mafredri commented 4 years ago

Hi @nathanchance, I've been unable to reproduce this. There's been similar issues before #547 and https://github.com/mafredri/zsh-async/issues/35, but these should have been fixed in zsh-async >= v1.8.1. You can check which version you have via echo $ASYNC_VERSION.

nathanchance commented 4 years ago

Well that would certainly make sense since it seems that the version of async.zsh that is bundled in this repository is 1.8.0 :)

If I manually update async.zsh to the latest from your tree, the issue is resolved. Thanks for the comment, I will keep the copy updated manually until it is updated here.