agnoster-zsh-theme icon indicating copy to clipboard operation
agnoster-zsh-theme copied to clipboard

How can I shorten the prompt?

Open sunilw opened this issue 3 years ago • 2 comments

I know this question has been asked and answered a lot. But I simply haven't been able to successfully do this:

By default the prompt shows the entire path of the current directory. I'd just like to show the current directory instead of the whole path.

If that isn't possible, I'll settle for removing everything except the user and host.

sunilw avatar Sep 02 '21 10:09 sunilw

unfortunately the theme doesn't offer a lot of customisation. a work around can be done by replacing the function:

 prompt_dir() {
   prompt_segment blue $CURRENT_FG ' %~ '
 }

by

 prompt_dir() {
   prompt_segment blue $CURRENT_FG ' %CD% '
 }

in (User)/.oh-my-zsh/themes/agnoster.zsh-theme

marcflavius avatar Oct 05 '21 20:10 marcflavius