-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Call fish_prompt after printing 'Job has ended' #1018
Comments
That callback might be computationally costly. Also, it's hard to think of how that should work with the history. I'm not against the idea, but how it behaves sounds like a matter of taste. |
@alexanderkyte, why do you think it will be computation costly? fish_prompt is called only in interactive mode on every 'enter' or after foreground job is finished. I'm sure there will be minimal impact if it will be called after background job finishes. A solution might be in introducing a 'function --on-job-exit all' capability to call a user function on each job exit. |
If you space it out long enough I'm sure it's fine. I was just picturing the 'immediate' use case. I'm not sure if there's a way to make a 'callback' on thread exit, and busy waiting like that could scale poorly in the presence of many, many shells. Actually, we could accomplish this by passing a callback function pointer to a 'supervisor' thread responsible for spawning new background processes, or do it one of a hundred different ways. I'm just trying to think of a way that doesn't add too much unnecessary complexity. Then again, there are probably other features that realtime updates would enable. Having a clock in your prompt is an immediate thought. |
@alexanderkyte, I'm still a bit confused. I'm talking only about current shell's background jobs which are anyway controlled by current shell. On exit of a background job fish anyway prints a message, so there is not much effort on updating fish_prompt after it. It would be indeed expensive to follow all started system applications, but it's not the case. |
With #6959 fish can be configured to do this by overriding |
@krobelus, that sounds sensible to me. |
If there is a number of background jobs printed in fish_prompt, it's not updated when some job ends. It seems that fish simply redraws the last prompt while it could call fish_prompt again.
The text was updated successfully, but these errors were encountered: