diff options
Diffstat (limited to 'test/functional/terminal/buffer_spec.lua')
-rw-r--r-- | test/functional/terminal/buffer_spec.lua | 92 |
1 files changed, 13 insertions, 79 deletions
diff --git a/test/functional/terminal/buffer_spec.lua b/test/functional/terminal/buffer_spec.lua index d36dc60a93..4635259e33 100644 --- a/test/functional/terminal/buffer_spec.lua +++ b/test/functional/terminal/buffer_spec.lua @@ -557,7 +557,7 @@ describe('terminal input', function() '--cmd', 'set notermguicolors', '-c', - 'while 1 | redraw | echo keytrans(getcharstr()) | endwhile', + 'while 1 | redraw | echo keytrans(getcharstr(-1, #{simplify: 0})) | endwhile', }) screen:expect([[ ^ | @@ -566,7 +566,10 @@ describe('terminal input', function() | {3:-- TERMINAL --} | ]]) - for _, key in ipairs({ + local keys = { + '<Tab>', + '<CR>', + '<Esc>', '<M-Tab>', '<M-CR>', '<M-Esc>', @@ -632,7 +635,14 @@ describe('terminal input', function() '<S-ScrollWheelRight>', '<ScrollWheelLeft>', '<ScrollWheelRight>', - }) do + } + -- FIXME: The escape sequence to enable kitty keyboard mode doesn't work on Windows + if not is_os('win') then + table.insert(keys, '<C-I>') + table.insert(keys, '<C-M>') + table.insert(keys, '<C-[>') + end + for _, key in ipairs(keys) do feed(key) screen:expect(([[ | @@ -643,82 +653,6 @@ describe('terminal input', function() ]]):format(key:gsub('<%d+,%d+>$', ''))) end end) - - -- TODO(bfredl): getcharstr() erases the distinction between <C-I> and <Tab>. - -- If it was enhanced or replaced this could get folded into the test above. - it('can send TAB/C-I and ESC/C-[ separately', function() - if - skip( - is_os('win'), - "The escape sequence to enable kitty keyboard mode doesn't work on Windows" - ) - then - return - end - clear() - local screen = tt.setup_child_nvim({ - '-u', - 'NONE', - '-i', - 'NONE', - '--cmd', - 'colorscheme vim', - '--cmd', - 'set notermguicolors', - '--cmd', - 'noremap <Tab> <cmd>echo "Tab!"<cr>', - '--cmd', - 'noremap <C-i> <cmd>echo "Ctrl-I!"<cr>', - '--cmd', - 'noremap <Esc> <cmd>echo "Esc!"<cr>', - '--cmd', - 'noremap <C-[> <cmd>echo "Ctrl-[!"<cr>', - }) - - screen:expect([[ - ^ | - {4:~ }|*3 - {5:[No Name] 0,0-1 All}| - | - {3:-- TERMINAL --} | - ]]) - - feed('<tab>') - screen:expect([[ - ^ | - {4:~ }|*3 - {5:[No Name] 0,0-1 All}| - Tab! | - {3:-- TERMINAL --} | - ]]) - - feed('<c-i>') - screen:expect([[ - ^ | - {4:~ }|*3 - {5:[No Name] 0,0-1 All}| - Ctrl-I! | - {3:-- TERMINAL --} | - ]]) - - feed('<Esc>') - screen:expect([[ - ^ | - {4:~ }|*3 - {5:[No Name] 0,0-1 All}| - Esc! | - {3:-- TERMINAL --} | - ]]) - - feed('<c-[>') - screen:expect([[ - ^ | - {4:~ }|*3 - {5:[No Name] 0,0-1 All}| - Ctrl-[! | - {3:-- TERMINAL --} | - ]]) - end) end) if is_os('win') then |