feat(terminal): trigger TermRequest autocommand events (#22159)

This commit implements a new TermRequest autocommand event and has Neovim
emit this event when children of terminal buffers emit an OSC or DCS sequence
libvterm does not handle.

The TermRequest autocommand event has additional data in the
v:termrequest variable.

Co-authored-by: Gregory Anders <greg@gpanders.com>
This commit is contained in:
Ghjuvan Lacambre
2024-01-09 15:27:56 +01:00
committed by GitHub
parent f40df63bdc
commit beca827212
11 changed files with 156 additions and 4 deletions

View File

@@ -770,13 +770,23 @@ M.vars = {
desc = 'Value of |String| type. Read-only. See: |type()|',
},
termresponse = {
type = 'string',
desc = [=[
The value of the most recent OSC or DCS escape sequence
The value of the most recent OSC or DCS control sequence
received by Nvim from the terminal. This can be read in a
|TermResponse| event handler after querying the terminal using
another escape sequence.
]=],
},
termrequest = {
type = 'string',
desc = [=[
The value of the most recent OSC or DCS control sequence
sent from a process running in the embedded |terminal|.
This can be read in a |TermRequest| event handler to respond
to queries from embedded applications.
]=],
},
testing = {
desc = [=[
Must be set before using `test_garbagecollect_now()`.