patch 9.1.1666: no support for terminal primary device attributes

Problem:  no support for terminal primary device attributes
Solution: Add support for detecting the DA1 response from the terminal,
          add the v:termda1 variable and the 't_Ms' option for the
          OSC 52 command format (Foxe Chen)

closes: #18033

Signed-off-by: Foxe Chen <chen.foxe@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Foxe Chen
2025-08-23 05:56:40 -04:00
committed by Christian Brabandt
parent 5d3c39af2a
commit 5734afebab
10 changed files with 52 additions and 8 deletions

View File

@ -1,4 +1,4 @@
*eval.txt* For Vim version 9.1. Last change: 2025 Aug 20
*eval.txt* For Vim version 9.1. Last change: 2025 Aug 23
VIM REFERENCE MANUAL by Bram Moolenaar
@ -2911,6 +2911,12 @@ v:termu7resp The escape sequence returned by the terminal for the |t_u7|
this option is set, the TermResponseAll autocommand event is
fired, with <amatch> set to "ambiguouswidth".
*v:termda1*
v:termda1 The escape sequence returned by a primary device attributes
(DA1) query from the terminal. When this option is set, the
TermResponseAll autocommand event is fired, with <amatch> set
to "da1". Can be used to detect OSC 52 support in a terminal.
*v:testing* *testing-variable*
v:testing Must be set before using `test_garbagecollect_now()`.
Also, when set certain error messages won't be shown for 2

View File

@ -1102,6 +1102,7 @@ $quote eval.txt /*$quote*
't_KJ' term.txt /*'t_KJ'*
't_KK' term.txt /*'t_KK'*
't_KL' term.txt /*'t_KL'*
't_Ms' term.txt /*'t_Ms'*
't_PE' term.txt /*'t_PE'*
't_PS' term.txt /*'t_PS'*
't_RB' term.txt /*'t_RB'*
@ -10587,6 +10588,7 @@ t_KI term.txt /*t_KI*
t_KJ term.txt /*t_KJ*
t_KK term.txt /*t_KK*
t_KL term.txt /*t_KL*
t_Ms term.txt /*t_Ms*
t_PE term.txt /*t_PE*
t_PS term.txt /*t_PS*
t_RB term.txt /*t_RB*
@ -11257,6 +11259,7 @@ v:t_string eval.txt /*v:t_string*
v:t_tuple eval.txt /*v:t_tuple*
v:t_typealias eval.txt /*v:t_typealias*
v:termblinkresp eval.txt /*v:termblinkresp*
v:termda1 eval.txt /*v:termda1*
v:termrbgresp eval.txt /*v:termrbgresp*
v:termresponse eval.txt /*v:termresponse*
v:termrfgresp eval.txt /*v:termrfgresp*

View File

@ -1,4 +1,4 @@
*term.txt* For Vim version 9.1. Last change: 2025 Aug 06
*term.txt* For Vim version 9.1. Last change: 2025 Aug 23
VIM REFERENCE MANUAL by Bram Moolenaar
@ -644,6 +644,9 @@ Note: Use the <> form if possible
<FocusGained> Vim window got focus (internal only)
<FocusLost> Vim window lost focus (internal only)
t_Ms OSC 52 command format (empty *t_Ms* *'t_Ms'*
if terminal doesn't support it)
Note about t_so and t_mr: When the termcap entry "so" is not present the
entry for "mr" is used. And vice versa. The same is done for "se" and "me".
If your terminal supports both inversion and standout mode, you can see two

View File

@ -1,4 +1,4 @@
*version9.txt* For Vim version 9.1. Last change: 2025 Aug 22
*version9.txt* For Vim version 9.1. Last change: 2025 Aug 23
VIM REFERENCE MANUAL by Bram Moolenaar
@ -41851,12 +41851,17 @@ Options: ~
'tabpanelopt' Optional settings for the |tabpanel|
't_xo' Terminal uses XON/XOFF handshaking (e.g. vt420)
't_CF' Support for alternate font highlighting terminal code
't_Ms' OSC 52 command format
'winfixbuf' Keep buffer focused in a window
'wlseat' Specify Wayland seat to use for the |wayland| feature
'wlsteal' Steal focus to access the |wayland| clipboard
'wltimeout' Specify the connection timeout for the |wayland|
compositor
Vim Variables: ~
|v:termda1| The escape sequence returned for the primary device
attribute query (DA1).
Vim Arguments: ~
|-Y| Do not connect to the |wayland| compositor.
|--clientserver| Specify backend for clientserver functionality.