[vim/vim] Send DECRQM sequences based on version response (PR #19938)

14 views
Skip to first unread message

Foxe Chen

unread,
Apr 8, 2026, 8:19:42 PM (8 days ago) Apr 8
to vim/vim, Subscribed

Should fix #19852


You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/19938

Commit Summary

  • f0e5daf send decrqm sequences based on version response

File Changes

(4 files)

Patch Links:


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19938@github.com>

h_east

unread,
Apr 9, 2026, 4:32:39 AM (8 days ago) Apr 9
to vim/vim, Subscribed
h-east left a comment (vim/vim#19938)

Thank you for your PR. Please confirm two points.
(This review was created by Claude Opus 4.6 with 1M context)

1. tpr_set_by_termresponse should be TRUE

File: src/term.c (init_term_props)

    term_props[TPR_DECRQM].tpr_set_by_termresponse = FALSE;

TPR_DECRQM is set to TPR_YES inside handle_version_response() (i.e., based on the DA2 response), so tpr_set_by_termresponse should be TRUE, not FALSE.

When tpr_set_by_termresponse is FALSE, init_term_props(FALSE) (called during terminal re-initialization) will NOT reset TPR_DECRQM, which means a stale value from a previous terminal could persist.

For reference, TPR_CURSOR_STYLE, TPR_CURSOR_BLINK, TPR_UNDERLINE_RGB, and TPR_MOUSE — all of which are set in handle_version_response() — have tpr_set_by_termresponse = TRUE.

2. GNU screen consideration

File: src/term.c (handle_version_response)

The xterm fallback block (where term_props[TPR_MOUSE].tpr_status is TPR_UNKNOWN) sets TPR_DECRQM = TPR_YES unconditionally. GNU screen (arg[0] == 83) matches an earlier branch and doesn't reach this fallback, so it won't get TPR_YES — which is probably correct since GNU screen likely doesn't support DECRQM. Just want to confirm this is intentional.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19938/c4212757322@github.com>

h_east

unread,
Apr 9, 2026, 4:33:53 AM (8 days ago) Apr 9
to vim/vim, Subscribed

@h-east commented on this pull request.


In runtime/doc/builtin.txt:

> @@ -11989,6 +11989,7 @@ terminalprops()						*terminalprops()*
 		   underline_rgb	whether |t_8u| works **
 		   mouse		mouse type supported
 		   kitty		whether Kitty terminal was detected
+		   decrqm		whether sending DECRQM sequences work.
⬇️ Suggested change
-		   decrqm		whether sending DECRQM sequences work.
+		   decrqm		whether sending DECRQM sequences work


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19938/review/4080849917@github.com>

Foxe Chen

unread,
Apr 10, 2026, 9:03:47 AM (7 days ago) Apr 10
to vim/vim, Push

@64-bitman pushed 1 commit.

  • 02900c9 send decrqm sequences based on version response


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19938/before/5c1ba4ed51fcb2ad965d9f72549ccd9799fb918b/after/02900c9a0b71a26198f1b86c0903858edeed5f98@github.com>

Foxe Chen

unread,
Apr 10, 2026, 9:05:44 AM (7 days ago) Apr 10
to vim/vim, Push

@64-bitman pushed 1 commit.

  • a627976 send decrqm sequences based on version response

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19938/before/02900c9a0b71a26198f1b86c0903858edeed5f98/after/a627976a2992e5b9e2d7a163030503ff41e90bc4@github.com>

Foxe Chen

unread,
Apr 10, 2026, 9:31:44 AM (7 days ago) Apr 10
to vim/vim, Push

@64-bitman pushed 1 commit.

  • e008d34 send decrqm sequences based on version response

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19938/before/a627976a2992e5b9e2d7a163030503ff41e90bc4/after/e008d34bd1bc4ec8a90978d6148f69840ec83a9d@github.com>

h_east

unread,
Apr 15, 2026, 11:48:43 AM (2 days ago) Apr 15
to vim/vim, Subscribed
h-east left a comment (vim/vim#19938)

Here are additional review comments.
(Supported by Claude Opus 4.6 with 1M context)

1. Missing TPR_DECRQM for PuTTY / SecureCRT

File: src/term.c (handle_version_response, version == 136 branch)

The PuTTY branch (arg[0] == 0 && version == 136) and SecureCRT branch (arg[0] == 1 && version == 136) don't set TPR_DECRQM. PuTTY supports DECRQM, so it should probably get TPR_YES. Without it, TPR_DECRQM stays TPR_UNKNOWN and DECRQM sequences won't be sent.

2. Missing TPR_DECRQM for libvterm / Konsole

File: src/term.c (handle_version_response, version == 100 || version == 115 branch)

The libvterm/Konsole branch doesn't set TPR_DECRQM either. Konsole supports DECRQM. For libvterm (used inside Vim's :terminal), it may not be needed, but the two share the same branch — might need to distinguish them or add a comment explaining why it's left as unknown.

3. arg[1] >= 2500 branch covers a wide range of terminals

File: src/term.c (handle_version_response)

if (arg[1] >= 2500)
{
    term_props[TPR_UNDERLINE_RGB].tpr_status = TPR_YES;
    term_props[TPR_DECRQM].tpr_status = TPR_YES;
}

This matches Gnome terminal (1;3801;0, 1;4402;0, 1;2501;0), xfce4-terminal (1;2802;0), and potentially other terminals. Do all of them handle DECRQM properly? The comment says "Assuming any version number over 2500 is not an xterm", which is quite broad.

4. need_flush and DECRQM sending moved outside #ifdef FEAT_TERMRESPONSE

File: src/term.c (handle_version_response)

The original send_decrqm_modes() was called inside #ifdef FEAT_TERMRESPONSE in vim_main2(). In the new code, the DECRQM sending and need_flush / out_flush() are placed outside the #ifdef FEAT_TERMRESPONSE block. If DECRQM sending depends on the termresponse feature, it should stay inside the #ifdef.

5. Guard termcap_active && cur_tmode == TMODE_RAW removed

File: src/term.c

The original send_decrqm_modes() had:

if (termcap_active && cur_tmode == TMODE_RAW)
{
    // send DECRQM ...
}

The new code in handle_version_response() sends DECRQM without this guard. If it's guaranteed that handle_version_response() is always called in raw mode, a brief comment noting that would be helpful.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19938/c4253473982@github.com>

Foxe Chen

unread,
Apr 15, 2026, 12:07:20 PM (2 days ago) Apr 15
to vim/vim, Push

@64-bitman pushed 1 commit.

  • 2b46723 send decrqm sequences based on version response

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19938/before/e008d34bd1bc4ec8a90978d6148f69840ec83a9d/after/2b46723635617986e2178564f807920640e4fa65@github.com>

Christian Brabandt

unread,
Apr 15, 2026, 2:04:14 PM (2 days ago) Apr 15
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#19938)

hm, this causes quite a few test failures. Let me re-trigger CI again.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19938/c4254340153@github.com>

Foxe Chen

unread,
Apr 15, 2026, 2:26:03 PM (2 days ago) Apr 15
to vim/vim, Push

@64-bitman pushed 1 commit.

  • 59af2b3 Change decrqm property from 'u' to 'y'

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19938/before/2b46723635617986e2178564f807920640e4fa65/after/59af2b37c95700841267d4f078ed5f494f0d6432@github.com>

Foxe Chen

unread,
Apr 15, 2026, 2:26:25 PM (2 days ago) Apr 15
to vim/vim, Subscribed
64-bitman left a comment (vim/vim#19938)

hm, this causes quite a few test failures. Let me re-trigger CI again.

Should be fixed


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19938/c4254463142@github.com>

Foxe Chen

unread,
Apr 15, 2026, 3:23:59 PM (2 days ago) Apr 15
to vim/vim, Push

@64-bitman pushed 2 commits.

  • acb5cfb send decrqm sequences based on version response
  • 539d94a Change decrqm property from 'u' to 'y'

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19938/before/59af2b37c95700841267d4f078ed5f494f0d6432/after/539d94a6701b52447b8023cf2b769cffc8c75067@github.com>

Christian Brabandt

unread,
Apr 16, 2026, 4:39:29 PM (9 hours ago) Apr 16
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#19938)

there still seem to be some screen dump failures :(


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19938/c4263254772@github.com>

Foxe Chen

unread,
Apr 16, 2026, 4:48:29 PM (9 hours ago) Apr 16
to vim/vim, Subscribed
64-bitman left a comment (vim/vim#19938)

there still seem to be some screen dump failures :(

I'll try fixing them when I can (soon hopefully), it is exam season for me :/


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19938/c4263308246@github.com>

Christian Brabandt

unread,
Apr 16, 2026, 4:57:11 PM (9 hours ago) Apr 16
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#19938)

no worries, take your time and good luck for your exams 🤞


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19938/c4263359373@github.com>

Reply all
Reply to author
Forward
0 new messages