]> git.ipfire.org Git - thirdparty/vim.git/commit
patch 9.2.0238: showmode message may not be displayed v9.2.0238
authorHirohito Higashi <h.east.727@gmail.com>
Tue, 24 Mar 2026 20:06:05 +0000 (20:06 +0000)
committerChristian Brabandt <cb@256bit.org>
Tue, 24 Mar 2026 20:11:07 +0000 (20:11 +0000)
commit9a2260d6cfa1053bdfd8b7febdfdbee1ebf17d12
treebf84da163fed42918bfff2b8c1f565db96b9c65e
parent25f6539645d805295b11253c7bd8632aa20604f4
patch 9.2.0238: showmode message may not be displayed

Problem:  showmode message may not be displayed (Yee Cheng Chin)
Solution: Don't call char_avail() in skip_showmode(), but check
          for anything in the stuff and typeahead buffer
          (Hirohito Higashi).

Fix "-- VISUAL --" not shown when terminal responses are pending

When starting Vim with a script that enters Visual mode (e.g.
"vim -S script.vim"), the "-- VISUAL --" mode message sometimes
doesn't appear. This happens because skip_showmode() calls
char_avail(), which reads raw terminal input and picks up terminal
response escape sequences (e.g. t_RV response). Combined with
!KeyTyped (which is TRUE after script execution), this causes
skip_showmode() to return TRUE, preventing the mode from being
displayed.

Fix this by checking only the stuff buffer and typeahead buffer for
pending characters, instead of char_avail() which also reads raw
terminal input. This way, terminal response sequences no longer
interfere with mode display.

fixes:  #16620
closes: #19801

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Christian Brabandt <cb@256bit.org>
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/screen.c
src/version.c