I would like to display only the first two letters of the current directory.
I tried
PROMPT="%1d %# " which displays the current directory as directory1. But taking a subset of the directory as the first two characters and displaying as the zsh prompt in MacOS is where I am lost.
How do I only get the first two characters, i.e. di instead of directory1 as the zsh prompt instead?
dir $and youcdtodirectory2? Is it nowdir/dir $?cdas a function, in which you calculate an updated prompt.zshyou can use aprecommandto execute arbitrary code to set the prompt.DocumentsandDownloads. Since they have the same first two letters, your prompt won't tell you which one you're in. Are you sure you don't want the prompt to be the first three or four letters of the directory name?