mirror of
https://github.com/neovim/neovim.git
synced 2025-12-09 16:12:48 +00:00
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:
@@ -317,6 +317,18 @@ describe(':terminal buffer', function()
|
||||
pcall_err(command, 'write test/functional/fixtures/tty-test.c')
|
||||
)
|
||||
end)
|
||||
|
||||
it('emits TermRequest events', function()
|
||||
command('split')
|
||||
command('enew')
|
||||
local term = meths.open_term(0, {})
|
||||
-- cwd will be inserted in a file URI, which cannot contain backs
|
||||
local cwd = funcs.getcwd():gsub('\\', '/')
|
||||
local parent = cwd:match('^(.+/)')
|
||||
local expected = '\027]7;file://host' .. parent
|
||||
meths.chan_send(term, string.format('%s\027\\', expected))
|
||||
eq(expected, eval('v:termrequest'))
|
||||
end)
|
||||
end)
|
||||
|
||||
describe('No heap-buffer-overflow when using', function()
|
||||
|
||||
Reference in New Issue
Block a user