So since I installed OSX Lion ive been having this crazy issue where editing a file in nano or vi would sometimes skip characters, or shuffle them around, particularly when I hit backspace. I would then save the file and open it and it would look nothing like what i entered. There is a solution!
- Go to Terminal > Preferences
- Go to Advanced
- Change the Declare terminal as: from xterm-256color to xterm-color
yay! I only has this issue while editing my CentOS boxes as that all i have anymore.