Skip to content
This repository has been archived by the owner on Apr 24, 2020. It is now read-only.

Async right prompt #262

Closed
wants to merge 6 commits into from
Closed

Async right prompt #262

wants to merge 6 commits into from

Conversation

ayyess
Copy link
Contributor

@ayyess ayyess commented May 16, 2016

This could be a solution to the lag experienced in #244.
An subprocess writes the prompt to a temporary file (unique to each zsh instance) as each element is loaded. A signal is send to the parent zsh process after each write so that the RPROMPT can be set to the new value. The temporary file is deleted when the zsh exits.

The three zle reset-prompt were removed from the other handlers as otherwise RPROMPT was reset to empty after hitting enter. However powerlevel9k_prepare_prompts handles zle reset-prompt so this shouldn't be a problem

@Tritlo
Copy link
Contributor

Tritlo commented May 16, 2016

Please make a pull request against next, that's where new stuff should come in.

That being said, when I try to run this I get:

remove /var/folders/wr/fk_4qbzn72x34r7xgs173d_40000gn/T/tmp.g0ohipLH? y
async:1: no such file or directory:
build_right_prompt:13: no such file or directory:
build_right_prompt:13: no such file or directory:

I am on os x, loading with zgen and zpresto.

@Tritlo
Copy link
Contributor

Tritlo commented May 16, 2016

Alright, I've forked your fork and fixed it for me on os x, see ayyess#1. Works great, though it is a bit annoying that it doesn't just wait for all the parts, but rather renders them as they come. Would be really nice to be able to just wait for segments to finish, and then render.

If you move the kill -S USR1 $$ outside of the loop, it waits until the entire segment is done rendering.

Edit: I've done that on my fork, and I think it looks a lot smoother.

@ayyess
Copy link
Contributor Author

ayyess commented May 16, 2016

I don't seem to be able to change the target branch of this pull so should I make a new pull request?
New request at #263

@ayyess ayyess mentioned this pull request May 16, 2016
@ayyess ayyess closed this May 16, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants