-
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
Hang when cat
is aliased to bat
#44
Comments
And for completeness here are my other plugins:
|
I can't see anything wrong in your example, and it works perfectly fine for me on macOS zsh 5.8 and Debian zsh 5.7.1. Additionally, since you're running the file (and not sourcing), your other plugins shouldn't matter as your regular prompt environment won't be loaded (assuming you keep your configuration in Try adding |
Another thing you can try adding at the very top, |
Thanks for the prompt reply. I noticed
|
This looks like it. Running that same line at an interactive prompt:
|
Scratch that, I've just found the manual for |
Hmm, interesting, your trace output is formatted differently than mine:
I noticed two other things:
|
Ah, well I've specifically configured Apologies yes I did re-order things, after finding a comment you made in another issue that functions/variables used by a worker need to be declared before that worker is started. It seems to make no difference in my case. The code as it stands now:
Still no joy though. |
On your second point, yes, Edit: did you mean a different function? My copy of |
Ah no, it was part of your first example. But not an issue, obviously it's missing when it's not part of the script 😂. Now. I managed to reproduce your issue with the missing Especially when the zpty is being both written to from both ends simultaneously. By running your first example in an endless for, loop, this resulted in me (re)discovering a second bug, one that has likely been haunting this project since #18. Please do give #45 a spin. I've also added the ability to debug the async worker, example: ASYNC_DEBUG=1
ASYNC_DEBUG_WORKER_STDERR=/tmp/my_worker_err.log
async_start_worker my_worker -n
Ah. The Consider: myfunc() {
print hi
}
async_start_worker mywork
async_job mywork myfunc vs. async_start_worker mywork
myfunc() {
print hi
}
async_job mywork myfunc In the latter case, the |
Interesting! I'm afraid I get the same behaviour on that branch. I've added the new debugging flags, and also a sleep at the start of the loop, but to no avail.
I also ran the test suite from that branch - it hangs on the first test
Here is the trace from running my script with the new sleep as above:
|
Right, found the culprit. I have this alias defined:
Now bat aims to be totally cat-like but the trace above suggests using |
cat
is aliaesd to bat
cat
is aliased to bat
See #47 for a fix |
Thanks @mafredri for your patience! Works a treat 👍 |
No problem, and glad to hear! Is that with #45 or without, btw? Well, either way, your issue resulted in quite a few improvements, so thanks to you too! 😄 |
Just come across this and I love the idea, but I'm struggling to get the example working. Given this script, based on your example:
I simply get
Waiting...
repeatedly. Pressing Ctrl-C ends it with no additional output. I'm not sure of the underlying implementation but looking in the process tree forzpty
yields nothing. (When calling this script as./test.zsh
, so not sourcing.)Am I doing something wrong?
zsh 5.8 on Arch.
The text was updated successfully, but these errors were encountered: