fix and improve the highlights

The highlights no longer glitch on inserting a newline just after using
the completion. Moreover, the terminal output is paused when the
completion is highlighted.