Skip to main content
The 2024 Developer Survey results are live! See the results

All Questions

Tagged with
1 vote
1 answer
141 views

How to hide the directory in prompt if directory has no change?

Can the prompt be hidden if the directory has no change after the last command executed? Show only the $, show the path only if the directory was changed in the last command. My ps1: precmd () { ...
Solarisending's user avatar
3 votes
1 answer
2k views

Limit git prompt branch name width in oh-my-zsh

I use long descriptive branch names in git, causing the prompt to take up too much space leaving less room for long paths. I would like to limit the git plugin's branch segment to something like 15 ...
Matthew's user avatar
  • 1,328
3 votes
1 answer
925 views

bash's command number ( \# ) equivalent in zsh

I'm looking for a character to put in my zsh's $PROMPT that would be equivalent to bash's \# (the command number of this command, according to this site). So far I've found only %h but this is not ...
shrx's user avatar
  • 464