From 5d21449a7263384c36553fd28482961374b2c02e Mon Sep 17 00:00:00 2001 From: nohzafk <149959021+nohzafk@users.noreply.github.com> Date: Tue, 2 Jan 2024 14:00:51 +0800 Subject: [PATCH] update fish shell directory tracking function --- README.md | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/README.md b/README.md index 64de4b28..4c973907 100644 --- a/README.md +++ b/README.md @@ -588,17 +588,9 @@ PS1=$PS1'\[$(vterm_prompt_end)\]' For `fish`, put this in your `~/.config/fish/config.fish`: ```fish -function vterm_prompt_end; +function vterm_prompt_end --on-variable PWD vterm_printf '51;A'(whoami)'@'(hostname)':'(pwd) end -functions --copy fish_prompt vterm_old_fish_prompt -function fish_prompt --description 'Write out the prompt; do not replace this. Instead, put this at end of your file.' - # Remove the trailing newline from the original prompt. This is done - # using the string builtin from fish, but to make sure any escape codes - # are correctly interpreted, use %b for printf. - printf "%b" (string join "\n" (vterm_old_fish_prompt)) - vterm_prompt_end -end ``` Here we are using the function `vterm_printf` that we have discussed above, so make