before reset, the output is emptied
removed the extra newline & PS1 wait. Now it just checks for $ or > at the end of the line & decide if the wait is over