mirror of
https://github.com/neovim/neovim.git
synced 2025-09-17 00:38:17 +00:00
feat(tui): support DCS responses in TermResponse event (#26061)
This commit is contained in:
@@ -513,12 +513,13 @@ void nvim_ui_pum_set_bounds(uint64_t channel_id, Float width, Float height, Floa
|
||||
ui->pum_pos = true;
|
||||
}
|
||||
|
||||
/// Tells Nvim when a terminal event has occurred: sets |v:termresponse| and fires |TermResponse|.
|
||||
/// Tells Nvim when a terminal event has occurred
|
||||
///
|
||||
/// The following terminal events are supported:
|
||||
///
|
||||
/// - "osc_response": The terminal sent a OSC response sequence to Nvim. The
|
||||
/// payload is the received OSC sequence.
|
||||
/// - "termresponse": The terminal sent an OSC or DCS response sequence to
|
||||
/// Nvim. The payload is the received response. Sets
|
||||
/// |v:termresponse| and fires |TermResponse|.
|
||||
///
|
||||
/// @param channel_id
|
||||
/// @param event Event name
|
||||
@@ -527,14 +528,14 @@ void nvim_ui_pum_set_bounds(uint64_t channel_id, Float width, Float height, Floa
|
||||
void nvim_ui_term_event(uint64_t channel_id, String event, Object value, Error *err)
|
||||
FUNC_API_SINCE(12) FUNC_API_REMOTE_ONLY
|
||||
{
|
||||
if (strequal("osc_response", event.data)) {
|
||||
if (strequal("termresponse", event.data)) {
|
||||
if (value.type != kObjectTypeString) {
|
||||
api_set_error(err, kErrorTypeValidation, "osc_response must be a string");
|
||||
api_set_error(err, kErrorTypeValidation, "termresponse must be a string");
|
||||
return;
|
||||
}
|
||||
|
||||
const String osc_response = value.data.string;
|
||||
set_vim_var_string(VV_TERMRESPONSE, osc_response.data, (ptrdiff_t)osc_response.size);
|
||||
const String termresponse = value.data.string;
|
||||
set_vim_var_string(VV_TERMRESPONSE, termresponse.data, (ptrdiff_t)termresponse.size);
|
||||
apply_autocmds_group(EVENT_TERMRESPONSE, NULL, NULL, false, AUGROUP_ALL, NULL, NULL, &value);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user