Good morning, please I installed fish (version 3.6.1) with tide (version 5.5.1) on Debian.
I configured tide with the following options selected …
Prompt Style (3) Rainbow
Prompt Colors (1) True color
Show current time? (1) No
Prompt Separators (2) Vertical
Prompt Heads (2) Blurred
Prompt Tails (2) Blurred
Prompt Height (1) One line
Prompt Spacing (2) Sparse
Icons (2) Many icons
All is well with this prompt for me until I go into several directories, like
cd ~/Development/freecodecamp/ResponsiveWebDesign/C01 Learn HTML/
and the result is
░▒▓ ~/Development/freecodecamp/ResponsiveWebDesign/C01 Learn HTML master ▓▒░
I would desire to have … ░▒▓ C01 Learn HTML master ▓▒░
The only modification from the default fish/tide installation
cat ~/.config/fish/conf.d/10-camechi-config.fish
# My configurations for fish shell 20230615
function fish_greeting
fortune
end
if type -q exa
alias ll "exa -l -g --icons"
alias lla "ll -a"
end
set -gx PATH $HOME/bin $HOME/.local/bin $PATH
My Screen
I would need necessary assistance to get the desired prompt.
I have read the documentations and tried some old hints from the forums/websites.
Using basename (pwd) or basename ($PWD) give me a text-like prompt.
I desire the current directory only with the fancy prompt in the image 😉
Thank you
2
Answers
I succeeded in getting my desired prompt, showing only the current directory name. Thanks to @faho for the helpful hint.
I created a fish script, 15-camechi_tide_pwd.fish, in the conf.d directory rather than directly changing the _tide_pwd.fish in functions directory. Below is the content of 15-camechi_tide_pwd.fish
Image of my terminal
This is not a thing that tide does. It doesn’t have an option for it – see their wiki.
That being said, tide is just a bunch of fish script, so you can adjust it if you want. However, it’s written in a fairly peculiar style that isn’t very amenable to overriding specific functions.
You can try changing _tide_pwd to
(using fish’s path builtin to avoid the often surprisingly slow
basename
command)The easiest way to do this is
funced _tide_pwd
andfuncsave _tide_pwd
once it works.This might work unless tide throws a wrench in the way.
Other than that, consider opening an issue on the tide repo.