Deep folders make the bash prompt silly. On my Unraid box something like /mnt/user/appdata/nextcloud/www/config eats half the line before I’ve typed a single character. Bash has a variable for that, and it’s one of the few prompt settings that needs no escape codes at all.
PROMPT_DIRTRIM tells bash how many trailing folders to keep when it fills in \w (and \W) in your prompt. The rest gets replaced with an ellipsis.
PROMPT_DIRTRIM=2
Type it at the prompt to try it, and add it to ~/.bashrc when you like it. With the default Debian or Ubuntu style prompt, which uses \w, the difference looks like this:
before: root@tower:/mnt/user/appdata/nextcloud/www/config#
after: root@tower:.../www/config#
I’d go for 2 or 3. One folder is often too little to know where you are (lots of folders are called config or data), and more than three brings the long line back. Home still shows as ~, so ~/projects/site/src becomes ~/.../site/src.
The caveat: it only works if your prompt actually uses \w. If your PS1 has a fixed path, a $PWD or comes from a prompt framework like Starship, this variable does nothing and you set the length in that tool instead. Check with echo "$PS1". Also, the cut is cosmetic only: pwd still prints the full path, which is what you’d copy when you need it.
Further reading: Bash variables (GNU Bash manual), Controlling the prompt (GNU Bash manual)