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

Git branch lingers after prevd-or-backward-word #38

Open
2-4601 opened this issue Aug 22, 2022 · 4 comments
Open

Git branch lingers after prevd-or-backward-word #38

2-4601 opened this issue Aug 22, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@2-4601
Copy link

2-4601 commented Aug 22, 2022

When I'm in a Git repository and I prevd-or-backward-word out of it with Alt+, the branch name still lingers on the prompt.

Reproducible in this container https://github.com/dideler/docker-fish-shell

~ ❱ fish --version
fish, version 3.2.2
~ ❱ fisher --version
fisher, version 4.4.2
~ ❱ fisher list 
jorgebucaran/fisher
jorgebucaran/hydro
~cd /tmp/src/jorgebucaran/hydro/
/t/s/j/hydro main ❱ # Press ALT-<left arrow> to run prevd-or-backward-word
~ main ❱ # This actually replaces the previous line

Also happens with Fish 3.5.1 on my actual system. Hydro version d4c107a.

@songsanli
Copy link

I think it's a feature of fish shell: https://fishshell.com/docs/current/interactive.html#shared-bindings

Alt+← and Alt+→ move the cursor one word left or right (to the next space or punctuation mark), or moves forward/backward in the directory history if the command line is empty. If the cursor is already at the end of the line, and an autosuggestion is available, Alt+→ (or Alt+F) accepts the first word in the suggestion.

@2-4601
Copy link
Author

2-4601 commented Aug 31, 2022

I think it's a feature of fish shell: https://fishshell.com/docs/current/interactive.html#shared-bindings

Alt+← and Alt+→ move the cursor one word left or right (to the next space or punctuation mark), or moves forward/backward in the directory history if the command line is empty. If the cursor is already at the end of the line, and an autosuggestion is available, Alt+→ (or Alt+F) accepts the first word in the suggestion.

Yes it is, and it's a nice feature :)
Just like moving backwards and forwards in your web browser history you can move backwards and forwards in directories.

The issue is that the feature doesn't currently work well in Hydro because the branch name of Git repositories gets stuck in the prompt even though you have moved out of that directory. This does not happen with the default Fish prompt.

@brandonpittman
Copy link

CleanShot.2022-09-01.at.07.57.45.mp4

This little video should demonstrate the issue. Never noticed it till now. When I back up into a previous directory, the Git branch doesn't update. Git branch doesn't refresh until running another command.

@jorgebucaran jorgebucaran added the bug Something isn't working label Aug 31, 2022
@jorgebucaran
Copy link
Owner

Reproduced, nice job everyone. 👌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants