A Zsh library for running asynchronous tasks without external tools using zsh/zpty.
zsh-async is a library for running asynchronous tasks in the Zsh shell without requiring external tools. It solves the problem of executing background tasks without cluttering the terminal or losing control over child processes, using zsh/zpty to manage pseudo-terminal environments.
Zsh users and developers building shell scripts, themes, or plugins that require non-blocking background operations, such as prompt updates or parallel task execution.
Developers choose zsh-async because it integrates seamlessly with Zsh, avoids external dependencies, and provides fine-grained control over asynchronous jobs with callback support, making it ideal for interactive shell enhancements.
Because your terminal should be able to perform tasks asynchronously without external tools!
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Uses zsh/zpty to run commands in pseudo-terminals without blocking the shell, eliminating external dependencies as emphasized in the intro.
Prevents multiple instances of the same job from running simultaneously via the -u flag in async_start_worker, reducing duplicate tasks.
Allows registering callbacks to receive detailed job results (name, return code, output, time) through async_process_results, enabling precise job tracking.
Supports creating multiple workers with independent queues via async_start_worker and async_job, facilitating parallel task execution as described in the overview.
Relies on NULL to end commands, so passing NULL characters as arguments is not recommended and can cause problems, as noted in the limitations section.
Requires functions to be defined before worker start to avoid 'command not found' errors, adding setup overhead for dynamic environments.
Depends on Zsh features like zsh/zpty and ZLE, making it incompatible with other shells and limiting cross-platform use.
Error codes like corrupt worker output or crashes (e.g., code 130) require manual recovery with async_stop_worker, introducing reliability concerns in production.