Skip to content
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

Consider moving away from zpty if possible #24

Open
ericfreese opened this issue Jun 11, 2018 · 2 comments
Open

Consider moving away from zpty if possible #24

ericfreese opened this issue Jun 11, 2018 · 2 comments

Comments

@ericfreese
Copy link

I just came across a method for implementing async in zsh that doesn't require the zpty module. Take a look at this commit in zsh-autosuggestions: zsh-users/zsh-autosuggestions#338

Not sure if it will work with zsh-async, but wanted to pass it along in case it might simplify things.

@mafredri
Copy link
Owner

mafredri commented Jun 14, 2018

Thanks for the suggestion! I have considered this method in the past, but the reasons for abandoning it escape me. (At least one reason is that I did not know about zle -F at the time.)

zsh-async does have some requirements that could be challenging using this approach:

  • Long running worker with multiple jobs/tasks running
    • (Reason for this is I've wanted to avoid the overhead of forking, the worker forks once and waits for jobs)
  • The worker needs to be able to terminate its jobs (this is done by sending a kill to the workers process group to ensure termination of all processes started by the jobs)
  • Not sure if a requirement, but at least it will not be possible to run applications (or run them in a mode) that expect the stdout to be connected to a terminal

IIRC there is also some difference in behavior between read and zpty -r (latter being more reliable) that might have affected this decision in the past. Although, this might not be relevant here.

Anywho, I'll take this up for consideration, and maybe experiment with it when I have some dead time 😄.

@Cyberbeni
Copy link

It would be nice to have a v2 using this other method. When I'm on my Linux machine, I usually get at least one of these zpty fd died, exiting events.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants