-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement TermResponse auto command for certain terminal response sequences #25856
Labels
Comments
gpanders
added a commit
to gpanders/neovim
that referenced
this issue
Nov 1, 2023
When the terminal emulator sends an OSC sequence to Nvim (as a response to another OSC sequence that was first sent by Nvim), populate the OSC sequence in the v:termresponse variable and fire the TermResponse event. This makes use of the already documented but unimplemented TermResponse event. This event exists in Vim but is only fired when Vim receives a primary device attributes response. Fixes: neovim#25856
gpanders
added a commit
to gpanders/neovim
that referenced
this issue
Nov 1, 2023
When the terminal emulator sends an OSC sequence to Nvim (as a response to another OSC sequence that was first sent by Nvim), populate the OSC sequence in the v:termresponse variable and fire the TermResponse event. This makes use of the already documented but unimplemented TermResponse event. This event exists in Vim but is only fired when Vim receives a primary device attributes response. Fixes: neovim#25856
gpanders
added a commit
to gpanders/neovim
that referenced
this issue
Nov 1, 2023
When the terminal emulator sends an OSC sequence to Nvim (as a response to another OSC sequence that was first sent by Nvim), populate the OSC sequence in the v:termresponse variable and fire the TermResponse event. This makes use of the already documented but unimplemented TermResponse event. This event exists in Vim but is only fired when Vim receives a primary device attributes response. Fixes: neovim#25856
gpanders
added a commit
to gpanders/neovim
that referenced
this issue
Nov 1, 2023
When the terminal emulator sends an OSC sequence to Nvim (as a response to another OSC sequence that was first sent by Nvim), populate the OSC sequence in the v:termresponse variable and fire the TermResponse event. The escape sequence is also included in the "data" field of the autocommand callback when the autocommand is defined in Lua. This makes use of the already documented but unimplemented TermResponse event. This event exists in Vim but is only fired when Vim receives a primary device attributes response. Fixes: neovim#25856
gpanders
added a commit
to gpanders/neovim
that referenced
this issue
Nov 2, 2023
When the terminal emulator sends an OSC sequence to Nvim (as a response to another OSC sequence that was first sent by Nvim), populate the OSC sequence in the v:termresponse variable and fire the TermResponse event. The escape sequence is also included in the "data" field of the autocommand callback when the autocommand is defined in Lua. This makes use of the already documented but unimplemented TermResponse event. This event exists in Vim but is only fired when Vim receives a primary device attributes response. Fixes: neovim#25856
gpanders
added a commit
to gpanders/neovim
that referenced
this issue
Nov 2, 2023
When the terminal emulator sends an OSC sequence to Nvim (as a response to another OSC sequence that was first sent by Nvim), populate the OSC sequence in the v:termresponse variable and fire the TermResponse event. The escape sequence is also included in the "data" field of the autocommand callback when the autocommand is defined in Lua. This makes use of the already documented but unimplemented TermResponse event. This event exists in Vim but is only fired when Vim receives a primary device attributes response. Fixes: neovim#25856
gpanders
added a commit
that referenced
this issue
Nov 6, 2023
When the terminal emulator sends an OSC sequence to Nvim (as a response to another OSC sequence that was first sent by Nvim), populate the OSC sequence in the v:termresponse variable and fire the TermResponse event. The escape sequence is also included in the "data" field of the autocommand callback when the autocommand is defined in Lua. This makes use of the already documented but unimplemented TermResponse event. This event exists in Vim but is only fired when Vim receives a primary device attributes response. Fixes: #25856
Also "request version" to decide if we can use 8-bit key sequences: |
This was referenced Nov 13, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Problem
The
TermResponse
autocommand is documented but not implemented. This is ported from Vim, which does implement it.The documentation states that this autocommand fires when
v:termresponse
is set, which is in turn set when the Neovim receives a primary device attributes response. None of this is actually true (today).Expected behavior
We can repurpose this event to provide plugins access to certain terminal response sequences. Of particular interest are OSC 52 and OSC 4.
OSC 52 allows Neovim to read the system clipboard. A plugin can write the sequence
OSC 52 ; ; ? ST
and the terminal will respond withOSC 52 ; ; <base64 encoded contents of clipboard> ST
. We can store this response inv:termresponse
and fire aTermResponse
autocommand so that plugins can receive the clipboard contents.Similarly, OSC 4 allows plugins to request the current terminal palette colors.
The autocommand will fire anytime
v:termresponse
is updated.v:termresponse
only contains the most recent value, so plugins must read it in aTermResponse
handler before it is overridden by another response sequence.The text was updated successfully, but these errors were encountered: