3

I'm running macOS Mojave, and I'm getting strange behavior from my Shift key.

After I've typed in any text in the terminal, if I press and release the Shift key, it will add ;2D;10D to the end of that string. For example, if I type hello and immediately press and release Shift after, it will become hello;2D;10D, and it will add that additional string as many times as I press and release Shift, e.g. pressing Shift twice at the end of hello would create hello;2D;10D;2D;10D, etc. If I have not typed in any text yet and press and release Shift nothing happens.

When I am in Vim Insert Mode, or in colon command mode, if I have typed anything, pressing and releasing the Shift key moves my cursor to right after the first character of that recently created string of characters. For example, I press i to enter Insert Mode. | represents my cursor. If I type in hello and press and release Shift immediately after, my cursor ends up here h|ello. I noticed that in Normal Mode, when I press and release Shift, the bottom right corner that displays your key press combinations quickly flashes ~@#.

To debug, I have removed all my plugins and commented out my .vimrc file, and I am still getting the same behavior. This behavior occurs in any terminal emulator I've used (the standard Mac terminal, iTerm2, VSCode command line, etc.) I don't get this behavior outside of the command line, e.g. when I use Microsoft Word, or even typing this now, pressing and releasing the Shift key has no effect. Any feedback on why this may be occurring would help!

0

Since it happens on both iTerm and Terminal.app, check the $TERM setting and try changing it to another standard terminal. xterm-256color usually works well.

echo "$TERM"            # remember the output of this so you can return to it if needed!
export TERM='xterm-256color'

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.