acomagu / fish-async-prompt

Make your prompt asynchronous to improve the reactivity.
MIT License
390 stars 22 forks source link

Old prompt is not cleared when new prompt is shorter #28

Closed evanrelf closed 3 years ago

evanrelf commented 4 years ago

My prompt displays Git dirty status and branch name, which takes a long time to run in my company's Git monorepo. fish-async-prompt gets rid of the lag I had before when waiting for Git to return so Fish could draw my prompt, but now there's a new problem.

~/Projects/company-name/the-monorepo [master]
λ cd ..

~/Projects/company-name the-monorepo [master]
λ echo foo bar
foo bar

~/Projects/company-name
λ

When my prompt becomes shorter, for example by changing to a parent directory, the old prompt doesn't get cleared completely. Only the parts that "overlap" get updated.

acomagu commented 4 years ago

@evanrelf Could you shere your prompt function code or config.fish?

evanrelf commented 4 years ago

Sure. Here's my fish_prompt

acomagu commented 4 years ago

Hmm, I cannot reproduce even if with your prompt function code.

What Fish version are you using?

and if possible, I want you to create reproduction procedure in the fresh environment, created by sh -c 'env -i TERM=$TERM HOME=$(mktemp -d) fish'.

robbplo commented 4 years ago

I've noticed this as well using https://github.com/matchai/spacefish

evanrelf commented 4 years ago

Sorry for the late reply @acomagu. I'm using fish 3.0.2. I tried to reproduce the problem I had in a fresh environment, but I ended up running into other issues and I didn't have time to fix them.

acomagu commented 4 years ago

Thanks! I reproduced with matchai/spacefish. I'll see it in this weekend.

acomagu commented 4 years ago

It's solved if this issue is fixed: https://github.com/fish-shell/fish-shell/issues/6532

acomagu commented 3 years ago

Today I rewrite the almost whole this plugin, and this issue seems no longer reproduced on the latest version(v1.1.0). Can anyone try?

evanrelf commented 3 years ago

@acomagu I installed the latest version of the plugin, and I no longer experience this issue 🎉

acomagu commented 3 years ago

@evanrelf Thank you!! I close here.