aboutsummaryrefslogtreecommitdiff
path: root/test/functional/terminal/buffer_spec.lua
diff options
context:
space:
mode:
authorGhjuvan Lacambre <code@lacamb.re>2024-01-09 15:27:56 +0100
committerGitHub <noreply@github.com>2024-01-09 08:27:56 -0600
commitbeca827212b106114c371f8bb61aa1a50810062f (patch)
tree8c48282193fef8f58768a03663df94bf00b8aa29 /test/functional/terminal/buffer_spec.lua
parentf40df63bdca33d343cada6ceaafbc8b765ed7cc6 (diff)
downloadrneovim-beca827212b106114c371f8bb61aa1a50810062f.tar.gz
rneovim-beca827212b106114c371f8bb61aa1a50810062f.tar.bz2
rneovim-beca827212b106114c371f8bb61aa1a50810062f.zip
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>
Diffstat (limited to 'test/functional/terminal/buffer_spec.lua')
-rw-r--r--test/functional/terminal/buffer_spec.lua12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/functional/terminal/buffer_spec.lua b/test/functional/terminal/buffer_spec.lua
index 480ca96289..d0462b5619 100644
--- a/test/functional/terminal/buffer_spec.lua
+++ b/test/functional/terminal/buffer_spec.lua
@@ -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()