acomagu / fish-async-prompt

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

support fish vi mode and other on-variable changes #50

Closed soraxas closed 2 years ago

soraxas commented 3 years ago

This PR closes #34 and #45 where it will repaint prompt when variable changes.

There's a variable $async_prompt_on_variable that controls which variable would fire the repaint function (by default it includes fish_bind_mode).

To fix #45, one can set

set -U async_prompt_on_variable fish_bind_mode PWD

to execute the async prompt when $PWD changes (I've tested and it does works).

NOTE: I wasn't sure why #34 mentioned that --on-variable does not work. It works when I'm testing on my fish.

$ fish --version
fish, version 3.1.2
soraxas commented 3 years ago

The switch case is needed because fish_bind_mode gets filtered out on the next case.

acomagu commented 2 years ago

Thank you!