Skip to content

Vim not accepting capital letters and control-keys #2689

@chrisbra

Description

@chrisbra
  • I was not able to find an open or closed issue matching what I'm seeing

Setup

  • Which version of Git for Windows are you using? Is it 32-bit or 64-bit?
$ git --version --build-options

git version 2.27.0.windows.1
cpu: x86_64
built from commit: 907ab1011dce9112700498e034b974ba60f8b407
sizeof-long: 4
sizeof-size_t: 8

  • Which version of Windows are you running? Vista, 7, 8, 10? Is it 32-bit or 64-bit?
$ cmd.exe /c ver

Microsoft Windows [Version 10.0.18362.900]
  • What options did you set as part of the installation? Or did you choose the
    defaults?
# One of the following:
> type "C:\Program Files\Git\etc\install-options.txt"
> type "C:\Program Files (x86)\Git\etc\install-options.txt"
> type "%USERPROFILE%\AppData\Local\Programs\Git\etc\install-options.txt"
$ cat /etc/install-options.txt

Editor Option: VIM
Custom Editor Path:
Path Option: Cmd
SSH Option: OpenSSH
Tortoise Option: false
CURL Option: OpenSSL
CRLF Option: CRLFAlways
Bash Terminal Option: MinTTY
Git Pull Behavior Option: Merge
Performance Tweaks FSCache: Enabled
Use Credential Manager: Enabled
Enable Symlinks: Disabled
Enable Pseudo Console Support: Enabled

  • Any other interesting things about your environment that might be related
    to the issue you're seeing?

I don't know

Details

  • Which terminal/shell are you running Git from? e.g Bash/CMD/PowerShell/other

mintty 3.1.6

git commit --amend

I am not exactly sure this is the right place to report it. However I only notice the problem when writing my commit message (e.g. when git calls Vim). When starting vim normally, I do not see this problem (and yes, I checked :version output, it is using the same vim every time).

The thing is, I cannot enter/type upper case letters or Ctrl-keys (neither in insert mode nor as commands), which kind of limits my ability to write commit messages or navigate around :/
Some letters still work, like ! or : (which require me to press shift). It looks like Vim is never receiving the keys.

This might as well be a Vim bug, however I cannot reproduce by running vim from within git-bash. I also spend some time chasing my option settings and configuration, to see if this is caused by it. While I see some differences, neither of them seems to cause this issue. So not sure.

I see that the default $TERM for mintty is xterm-256color and that's also what :set term? returns. So as a blind guess, I did :set term=builtin_vt320 and I still have colors available and upper case letters seem to work again.

Since Vim has been implementing xtermModifyOtherKeys (https://invisible-island.net/xterm/modified-keys.html) in the late 8.2 versions, I suspect, that Vim is somehow confused about the terminal capabilities and if I add those lines to /etc/vimrc to disable the modify-other-key feature of Vim:
" disable xterm modifyOtherKeys
let &t_TI=''
let &t_TE=''

Vim works flawless as my commit editor again. It might be advisable to add those lines to /etc/vimrc in any case, since I suspect it is quite unlikely, that mintty will support xterms modify-other-key feature anytime soon.

I suppose an update to the Vim package could also fix it, there were quite some patches and bugfixes around this particular feature recently (and also how vim is detecting a true xterm terminal).

Keyboard layout and locale of Windows is German.

For the record, this is the output of :version:

VIM - Vi IMproved 8.2 (2019 Dec 12 kompiliert am Apr 18 2020 07:56:56)
Inklusive der Patches: 1-592
Übersetzt von <alexpux@gmail.com>
Riesige Version ohne GUI. Ein- (+) oder ausschließlich (-) der Eigenschaften:
+acl               -farsi             +mouse_sgr         +tag_binary
+arabic            +file_in_path      -mouse_sysmouse    -tag_old_static
+autocmd           +find_in_path      +mouse_urxvt       -tag_any_white
+autochdir         +float             +mouse_xterm       -tcl
-autoservername    +folding           +multi_byte        +termguicolors
-balloon_eval      -footer            +multi_lang        +terminal
+balloon_eval_term +fork()            -mzscheme          +terminfo
-browse            +gettext           +netbeans_intg     +termresponse
++builtin_terms    -hangul_input      +num64             +textobjects
+byte_offset       +iconv             +packages          +textprop
+channel           +insert_expand     +path_extra        +timers
+cindent           +ipv6              +perl/dyn          +title
-clientserver      +job               +persistent_undo   -toolbar
+clipboard         +jumplist          +popupwin          +user_commands
+cmdline_compl     +keymap            +postscript        +vartabs
+cmdline_hist      +lambda            +printer           +vertsplit
+cmdline_info      +langmap           +profile           +virtualedit
+comments          +libcall           +python/dyn        +visual
+conceal           +linebreak         +python3/dyn       +visualextra
+cryptv            +lispindent        +quickfix          +viminfo
+cscope            +listcmds          +reltime           +vreplace
+cursorbind        +localmap          +rightleft         +wildignore
+cursorshape       -lua               +ruby/dyn          +wildmenu
+dialog_con        +menu              +scrollbind        +windows
+diff              +mksession         +signs             +writebackup
+digraphs          +modify_fname      +smartindent       -X11
-dnd               +mouse             -sound             -xfontset
-ebcdic            -mouseshape        +spell             -xim
+emacs_tags        +mouse_dec         +startuptime       -xpm
+eval              -mouse_gpm         +statusline        -xsmp
+ex_extra          -mouse_jsbterm     -sun_workshop      -xterm_clipboard
+extra_search      +mouse_netterm     +syntax            -xterm_save
          System-vimrc-Datei: "/etc/vimrc"
        Benutzer-vimrc-Datei: "$HOME/.vimrc"
zweite Benutzer-vimrc-Datei: "~/.vim/vimrc"
        Benutzer-exrc-Datei: "$HOME/.exrc"
      defaults Datei: "$VIMRUNTIME/defaults.vim"
    Voreinstellung für $VIM: "/etc"
        und für $VIMRUNTIME: "/usr/share/vim/vim82"
Übersetzt: gcc -c -I. -Iproto -DHAVE_CONFIG_H   -I/usr/include/ncursesw  -march=x86-64 -mtune=generic -O2 -pipe -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linken: gcc   -L. -pipe -fstack-protector-strong -pipe -Wl,--as-needed -o vim.exe        -lm -lelf    -lncursesw -liconv -lacl -lintl   -Wl,--enable-auto-import -Wl,--export-all-symbols -Wl,--enable-auto-image-base -fstack-protector-strong  -L/usr/lib/perl5/core_perl/CORE -lperl -lpthread -ldl -lcrypt

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions