Prompt before command output in terminal
On Fedora 26 when using the terminal window, why does the shell return the prompt (or only part of the prompt) before it outputs the result of the previously input command? I'm running gnome XTerm. This has only started since I upgraded to Fedora 26.
My prompt is defined as two lines with the first line containing my login name@the current directory followed by line 2 which is a $ if I'm a regular user or SU: # if I have become root.
What happens now is that as soon as I enter a command the shell returns the 2nd line of my prompt followed by the output of the command and then a full prompt (both lines).
I have made no changes to my .bashrc or my .bash_profile.
Any help in trying to figure out what's going on would be appreciated. It's annoying especially when the system takes a while to generate output because if you don't look closely you think you have a prompt but you really don't and the system just stacks the commands and you get tons of output that may fill up the terminal buffers making it impossible to scroll back up to find the first command output.
Thanks
Could you please add the contents of your prompt definition?
I figured it out! My prompt was defined incorrectly, but it had worked for a really long time but I guess bash doesn't now like explicit newlines in variables. See my answer for details.
I quickly formatted your answer below to show you how it can look like. Please revert if you don't like it.