I sometimes manage to get my terminal messed up until I type "clear". This occurs in various ways, sometimes when writing individual commands, sometimes when editing something in a text editor. Now I have Mac OS X Lion, but I remember having this problem years ago even when I was still using Solaris.
Here's one case I managed to reproduce. If I make a mistake with cURL:
Bemmu-Sepponens-MacBook-Pro:b2 bemmu$ curl --data abcde=foo efghijk=bar http://localhost:1234/do_something_cool
curl: (6) Couldn't resolve host 'efghijk=bar'
foo Bemmu-Sepponens-MacBook-Pro:b2 bemmu$
Curl outputted "foo" and an error message. Now if I press the up arrow to return to edit that command, it first becomes like this:
Bemmu-Sepponens-MacBook-Pro:b2 bemmu$ curl --data abcde=foo efghijk=bar http://localhost:1234/do_something_cool
curl: (6) Couldn't resolve host 'efghijk=bar'
foo Bemmu-Sepponens-MacBook-Pro:b2 bemmu$ curl --data abcde=foo efghijk=bar http://localhost:1234/do_something_cool
Everything still looks OK, but notice the previous line was put after "foo" which came from cURL. Now if I try to press the left arrow enough times to get to the place where the error was and start typing, things become messed up:
foo Bemmu-Sepponens-MacBook-Pro:b2 bemmu$ curl --data abcde=foo&ijk=bar http://localhost:1234/do_something_cool
All I did was go to the place immediately after "abcde=foo " and press the backspace once and then put in an ampersand. It should have become "abcde=foo&fghijk=bar" but instead it became "abcde=foo&ijk=bar".
Is this normal, or do I have some setting wrong somewhere?