-
Notifications
You must be signed in to change notification settings - Fork 35
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
stderr stays mapped to /dev/null #35
Comments
@rgouicem what version of zsh and operating system did you experience this on? It might be a zsh bug. The async worker is a clone of your shell but it shouldn't be able to affect its file descriptors. I haven't seen this happen on any of my systems. |
I'm currently using zsh 5.7.1 on Arch Linux (might have been updated since my post). I'm also thinking it might be a zsh bug since it happened again a few times (less frequently than before my fix, but still). I'm gonna try to investigate a little bit more and maybe open an issue for zsh. |
I observe the same issue, zsh 5.7.1 on Debian stable and zsh 5.8 on Arch. I'm using the sorin prompt though,
Any ideas on how to debug this further? It is very annoying :) |
@fd0 oh yeah, that would be super annoying. I'd like to be able to reproduce this somehow, but so far I haven't been able to. I'm wondering if it can be something specific to your Line 71 in 95c2b15
I have two ideas on what we could try though. The first is to modify this section: Lines 489 to 492 in 95c2b15
With: exec {errfd}>&2
zpty -b $worker _async_worker -p $$ $args 2>&$errfd || {
async_stop_worker $worker
return 1
}
exec {errfd}>& - The idea being that we're creating a temporary fd that hopefully is active when the zpty is created, and thus will not reference back to our main stderr fd. The second is to just add a random |
Thanks for the fix @mafredri ! I have been trying it for 10 days now, and I don't think I encountered the problem since. |
@rgouicem that's great news, thanks for reporting. Which fix were you using btw? |
The first one, not the |
I went ahead and released this now as v1.8.1. Let's hope it works for others too, let me know if any issues pop up! |
I have
|
@jamesoff I can't reproduce the issue (with |
Definitely doing Oddly, it's also causing neovim to segfault as it starts, which I imagine is due to one of my plugins shelling out and being affected in some fashion. Again, (Edit: not a minimum reproducer, but in case something stands out to you, here's my config, pointing to where I'm using async: https://github.com/jamesoff/zsh/blob/master/.zshrc#L227) |
This commit fixes a clobbering issue of errfd because it was initialized as an integer (and thus zero value). Instead of always allowing clobbering, we initialize it as -1 which makes zsh happy and protects us from accidentally clobbering something in the future. The error fixed was: can't clobber parameter errfd containing file descriptor 0 Possible fix for clobbering issue mentioned in #35.
I've updated my install and have re-enabled |
seems fixed the bug of stderr be mapped to /dev/null mafredri/zsh-async#35
seems fixed the bug of stderr be mapped to /dev/null mafredri/zsh-async#35
seems fixed the bug of stderr be mapped to /dev/null mafredri/zsh-async#35
seems fixed the bug of stderr be mapped to /dev/null mafredri/zsh-async#35
I'm using zsh-async through alien (https://github.com/eendroroy/alien). alien is a prompt theme that uses zsh-async to update the git part of the prompt asynchronously.
Sometimes, I noticed that stderr was no longer printed in my terminal (with
echo foo >&2
). After some investigation, I realized that stderr was actually mapped to/dev/null
(withls -l /proc/self/fd
).While searching for what caused this, I found this line:
zsh-async/async.zsh
Line 71 in 95c2b15
Commenting it resolved my problem. I don't know if it is a good way to resolve my issue, this actual errors that should be hidden would be printed.
The text was updated successfully, but these errors were encountered: