I'm using bash as my shell and iTerm2 build 3.3.1 as my terminal emulator on Mac OS X 10.14.6 Whenever I use a type a long command, iTerm window overwrites my current line with the new symbols even though if I type proper command and run it, it runs successfully meaning, error is only in displaying command, not storing it. This also happens sometimes when I exit vim. Some of the buffer remains on screen, but my window is on shell, not on vim. This mainly happens when I use ctags and cscope. Screenshots of a long command and exiting vim are attached.
Please suggest some solution.
I figured out that bash was misbehaving in case of commads because for color coding in
PS1, I used
\e[....m type of format. When I replaced with
\[...\] then bash prompt issue got solved. I don't know why did it happen. Also issue about clearing shell buffer after exiting vim still happens (image 2).. any help regarding these would be helpful. Thanks!