Sample Header Ad - 728x90

Customize zsh prompt to separately show tail of current working dir

1 vote
1 answer
1179 views
So my current prompt looks like this: ~/path/to/dir % If possible, I'd like it to show the topmost dir separately, like this: ~/path/to (dir) % I've gotten close! In my .zshrc, I currently have: PROMPT="%~ (%1d) %#" which outputs: ~/path/to/dir (dir) % I just need to remove the last folder "dir" from the first path. Any ideas? (Note: I asked this question in Stack Overflow and got redirected here.)
Asked by user11319 (11 rep)
Nov 28, 2018, 07:09 PM
Last activity: Nov 28, 2018, 08:31 PM