prompt_pwd - print a prompt-friendly current directory.
prompt_pwd [-d n|--dir-length n] [-D n|--full-length-dirs n]
prompt_pwd prints the shell's current directory for prompt display. If the directory is under $HOME, that prefix is replaced with ~.
-d or --dir-length keeps the first n characters of shortened path components. A value of zero disables component shortening. A leading dot is preserved. -D or --full-length-dirs keeps the last n components at full length.
prompt_pwd # ~/repos/rush prompt_pwd -d 1 # ~/r/rush prompt_pwd -d 1 -D 2 # ~/repos/rush
Zero on success and two for usage errors.
rush-builtins(7), prompt(1), prompt_duration(1), rush configuration.