If the HTTP response body for a curl request doesn\'t contain a trailing newline, I end up with this really annoying condition where the shell prompt is in the middle of the
The general solution for bash is to add a newline symbol into the command prompt:
See related question (How to have a newline before bash prompt? ) and corresponding answer
This solution covers each command, not only curl.
echo $PS1 # To get your current PS1 env variable's value aka '_current_PS1_'
PS1='\n_current_PS1_'
The only side-effect is that you get command prompt after each 2nd line.