PROMPT_PWD(1)

NAME

prompt_pwd - print a prompt-friendly current directory.

SYNOPSIS

prompt_pwd [-d n|--dir-length n] [-D n|--full-length-dirs n]

DESCRIPTION

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.

EXAMPLES

prompt_pwd                  # ~/repos/rush
prompt_pwd -d 1             # ~/r/rush
prompt_pwd -d 1 -D 2        # ~/repos/rush

EXIT STATUS

Zero on success and two for usage errors.

SEE ALSO

rush-builtins(7), prompt(1), prompt_duration(1), rush configuration.