acomagu / fish-async-prompt

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

[Bug] $status not passed to prompt #75

Open 00-kat opened 4 months ago

00-kat commented 4 months ago

What I did:

To demonstrate, here's a simple function:

function statcode --description 'Change the status code'
    return $argv[1]
end

Testing:

[I] user@host ~ [1]> statcode 124
[I] user@host ~ [1]> echo $status
124
[I] user@host ~ [1]> statcode 2
[I] user@host ~ [1]> echo $status
2
[I] user@host ~ [1]> statcode 1
[I] user@host ~ [1]> echo $status
1

Notice how the status is always 1.

mal1kc commented 4 months ago

i have experienced same issue,i think it's related to 23e416fdece97c388173ba2c0065a10d185a0821 have temporary solution by using specific commit a89bf4216b65170e4c3d403e7cbf24ce34b134e6 like:

# _Don't forget to remove master version before install specific commit_

fisher remove acomagu/fish-async-prompt

fisher install acomagu/fish-async-prompt@a89bf4216b65170e4c3d403e7cbf24ce34b134e6
m-torhan commented 2 months ago

It looks like $jobs isn't passed neither:

┌[maciej@alpha]-[~]
└$ sleep 3 &

┌[maciej@alpha]-[~]
└$ sleep 3 &

┌[maciej@alpha]-[~]
└$ 
fish: Job 1, 'sleep 3 &' has ended

┌[maciej@alpha]-[~]
└$ 
fish: Job 2, 'sleep 3 &' has ended

┌[maciej@alpha]-[~]
└$ 

Same behavior is observed while using acomagu/fish-async-prompt@a89bf4216b65170e4c3d403e7cbf24ce34b134e6. It also messes up transient prompt.

Expected behavior (mine transient prompt is $time-$character):

[22:16:59]-$ sleep 3 &
[22:16:59]-$ sleep 3 &

┌[maciej@pi]-[~]
└[✦2]-$ 
fish: Job 1, 'sleep 3 &' has ended

┌[maciej@pi]-[~]
└[✦]-$ 
fish: Job 2, 'sleep 3 &' has ended

┌[maciej@pi]-[~]
└$