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

update fish shell directory tracking function #694

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nohzafk
Copy link
Contributor

@nohzafk nohzafk commented Jan 2, 2024

for current fish version 3.6.1, the directory tracking instruction on README does not work.

set the vterm_prompt_end function to trigger whenever the current directory changes. This can be done using the --on-variable PWD hook.

This modification ensures that vterm_prompt_end is called every time the PWD variable changes, which occurs whenever user change directories.

With the above change, we don't need to call vterm_prompt_end from within fish_prompt anymore.

@nohzafk
Copy link
Contributor Author

nohzafk commented Jan 2, 2024

check for running fish in vterm also works.

if [ "$INSIDE_EMACS" = vterm ]
    function vterm_prompt_end --on-variable PWD
        vterm_printf '51;A'(whoami)'@'(hostname)':'(pwd)
    end
end

@Sbozzolo
Copy link
Collaborator

I am running fish 3.7 and the version in the README works, but I wouldn't mind updating to a cleaner version.

Is your proposed solution backward compatible?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants