Some command line interface tools return a broken console when canceled by
Sometimes the text is invisible, or there are graphic problems until I run the command
(I use bash, but expect it is independent of the shell.)
Does this effect have a name? What causes this, and how can programmers prevent this in the tools? Is there a strategy how this problem is addressed in the major programming languages?