diff options
Diffstat (limited to 'test/functional/terminal/buffer_spec.lua')
-rw-r--r-- | test/functional/terminal/buffer_spec.lua | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/test/functional/terminal/buffer_spec.lua b/test/functional/terminal/buffer_spec.lua index d0462b5619..497d7668e8 100644 --- a/test/functional/terminal/buffer_spec.lua +++ b/test/functional/terminal/buffer_spec.lua @@ -318,16 +318,23 @@ describe(':terminal buffer', function() ) end) - it('emits TermRequest events', function() + it('emits TermRequest events #26972', function() command('split') command('enew') local term = meths.open_term(0, {}) + local termbuf = meths.get_current_buf().id + + -- Test that autocommand buffer is associated with the terminal buffer, not the current buffer + command('au TermRequest * let g:termbuf = +expand("<abuf>")') + command('wincmd p') + -- 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')) + eq(termbuf, eval('g:termbuf')) end) end) |