I show my full working directory plus other information (git, etc) in my bash prompt and sometimes it gets very long.
I want to add a newline to the end of my prompt so I can type the command on the next line, but only if the prompt is long e.g. more than 50 characters.
| ~ $ Typing a command here is nice |
| ~/foo/longDirectoryName/longsubirectory/src/package (master +*) $ Typing here s| | ucks. I want to just start on a new line |
Obviously, If I wanted to always type my command on the next line, I could just add a newline to
PS1 (as in this post). But I haven't found a way to do that conditionally because
PS1 is just a format string.
P.S. I'm actually using ZSH trying to customize the Agnoster theme but I imagine any solution for bash in general would help.