Sometimes, while using vim (no matter, on remote machine or the local one), my arrow keys suddenly stop reacting. I know, a true vimmer should use "hjkl" instead, but the question is different.

I've noticed that if I'm sending application to background, using ^Z, and then calling it back, arrow keys are working again.

Have you noticed such behavior? Can somebody explain from the technical point of view, what is going on behind the scenes?

By the way, even OS's are different, MacOS, debian, FreeBSD.


For historical reasons, the arrow keys can work in either "ANSI" or "application" mode. vim uses terminfo which generally specifies the application mode for arrow keys.

For some reason you're doing something to reset it to the default ANSI mode. Are you perhaps resetting the terminal while still in vim? When you press ^Z and then fg again vim will again activate the application mode.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.