You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, thanks for this library! This awesome 🥇
This is not strictly a zsh-async qn but it might be helpful to others so asking here: What would be the recommended way to display output from the callback fn?
Using normal echo can result in a messy output since the echo output could mess with the current BUFFER making both the output and the command being typed unreadable.
I use powerlevel10k which has a feature called transient prompt. The tl:dr; is that it triggers a zle reset-prompt as a preexec function which basically clears any printed text from the (now-)previous-line prompt.
Do you have any suggestions on how I can safely show my output given the above two constraints?
The text was updated successfully, but these errors were encountered:
Gautham
changed the title
Safe way to provide output in callback fn?
Safe way to print output from callback fn
Nov 17, 2020
Generally you want to start async jobs in precmd hooks to get information for prompt segments and then reset-prompt when you get them.
If you want to run scripts manually, you really should just be using regular foreground/background jobs.
Or if you want to have something similar to background jobs but the output is written to files and then you see in one of the prompt segments how many unread outputs you have, I guess that is also doable.
First of all, thanks for this library! This awesome 🥇
This is not strictly a zsh-async qn but it might be helpful to others so asking here: What would be the recommended way to display output from the callback fn?
zle reset-prompt
as a preexec function which basically clears any printed text from the (now-)previous-line prompt.Do you have any suggestions on how I can safely show my output given the above two constraints?
The text was updated successfully, but these errors were encountered: