That usually happens when vi is running in a mode that doesn’t understand your terminal’s arrow key escape sequences.
Here’s why:
-
Arrow keys don’t send a single character; they send an escape sequence (for example, the Up arrow sends
ESC [ A). -
If
vi(or more commonly the very oldex/viimplementation, notvim) doesn’t recognize these escape sequences, it just displays the trailing characters likeA,B,C,D(or sometimesM) instead of moving the cursor.
Common reasons
-
You’re actually running
vi, notvim.
Some minimal Linux/Unix systems only ship with the original BSDvi, which lacks proper arrow key support. -
Terminal

最低0.47元/天 解锁文章
1万+

被折叠的 条评论
为什么被折叠?



