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

Wrap git status command with GNU timeout #20

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sbliven
Copy link

@sbliven sbliven commented Jul 29, 2020

This should limit one of the biggest reasons for slow prompts,
mitigating #6.

Set $AGNOSTER_PROMPT_TIMEOUT to limit the amount of time the git
command can run.

This requires GNU timeout, so it is disabled by default.

I tried to make this apply globally for all prompts. However,
GNU timeout only works for full processes, not for shell functions.
My attempt at a zsh
implementation

failed due to job control limitations on non-interactive shells.

This should limit one of the biggest reasons for slow prompts,
mitigating apjanke#6.

Set `$AGNOSTER_PROMPT_TIMEOUT` to limit the amount of time the git
command can run.

This requires GNU timeout, so it is disabled by default.

I tried to make this apply globally for all prompts. However,
GNU `timeout` only works for full processes, not for shell functions.
My attempt at a [zsh
implementation](https://gist.github.com/sbliven/0da4eba5380ba514accb4118d481fbc9)
failed due to job control limitations on non-interactive shells.
@sbliven
Copy link
Author

sbliven commented Jul 29, 2020

Oh, I should have also mentioned that it obeys the per-repository git setting oh-my-zsh.hide-status, just like agnoster

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

Successfully merging this pull request may close these issues.

1 participant