I wanted to use the set-title function from https://askubuntu.com/a/774543/435408 to make the terminal title into a sort of status bar. That way I can see in the GUI whether my server is Running or Complete.
set-title Running && doStuff.sh && set-title Complete
With this code, you never see the title change to "Running", only "Complete". I believe this is because the title only changes when the system reads PS1 to make a new prompt, after all three commands run.
I got "Running" to show right away by putting the other commands in the background:
doStuff.sh && set-title Complete & set-title Running; fg
But then the terminal title was never set to "Complete" because that call was in the background. "fg" didn't help.
I had similar problems with
set-title Running; echo "doStuff.sh; set-title Complete" | at now + 0 minutes
Finally, I tried opening a new terminal tab titled "Running", as per https://askubuntu.com/a/860484/435408, but I was not able to pass any commands to the bash session to set its title to "Complete". The tab closes right away if I try using --rcfile or -c.
gnome-terminal --tab -e "bash -c 'printf \"\033]0;Running\007\"; sleep 4; exec bash'"