diff options
author | erw7 <erw7.github@gmail.com> | 2019-06-10 11:22:07 +0900 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2019-06-10 16:43:52 +0200 |
commit | ce90a19abd5ba0188454574ee7691d06a4534f8a (patch) | |
tree | d8ea5b2c9d43b8784033b2d1ba01880690a07360 /test | |
parent | 04e2ba85b1135a669f626ed59ceb2f797bc40997 (diff) | |
download | rneovim-ce90a19abd5ba0188454574ee7691d06a4534f8a.tar.gz rneovim-ce90a19abd5ba0188454574ee7691d06a4534f8a.tar.bz2 rneovim-ce90a19abd5ba0188454574ee7691d06a4534f8a.zip |
TUI: set os/input.c:global_fd to input->in_fd #10174
Problem: When we changed startup to wait for the TUI (like a remote UI),
we forgot to set os/input.c:global_fd. That used to be done by
input_start().
Solution: Initialize os/input.c:global_fd before initializing libtermkey
(termkey_new_abstract) so that tui_get_stty_erase() and
friends can inspect the correct fd.
fixes #10134
close #10174
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/terminal/tui_spec.lua | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/test/functional/terminal/tui_spec.lua b/test/functional/terminal/tui_spec.lua index 56d6f68b7a..defa700f3b 100644 --- a/test/functional/terminal/tui_spec.lua +++ b/test/functional/terminal/tui_spec.lua @@ -268,14 +268,13 @@ describe('TUI', function() end) end) -describe('TUI with non-tty file descriptors', function() - before_each(helpers.clear) - +describe('TUI', function() + before_each(clear) after_each(function() - os.remove('testF') -- ensure test file is removed + os.remove('testF') end) - it('can handle pipes as stdout and stderr', function() + it('with non-tty (pipe) stdout/stderr', function() local screen = thelpers.screen_setup(0, '"'..nvim_prog ..' -u NONE -i NONE --cmd \'set noswapfile noshowcmd noruler\' --cmd \'normal iabc\' > /dev/null 2>&1 && cat testF && rm testF"') feed_data(':w testF\n:q\n') @@ -289,6 +288,22 @@ describe('TUI with non-tty file descriptors', function() {3:-- TERMINAL --} | ]]) end) + + it('<C-h> #10134', function() + local screen = thelpers.screen_setup(0, '["'..nvim_prog + ..[[", "-u", "NONE", "-i", "NONE", "--cmd", "set noruler", "--cmd", ':nnoremap <C-h> :echomsg "\<C-h\>"<CR>']]..']') + + command([[call chansend(b:terminal_job_id, "\<C-h>")]]) + screen:expect([[ + {1: } | + {4:~ }| + {4:~ }| + {4:~ }| + {5:[No Name] }| + <C-h> | + {3:-- TERMINAL --} | + ]]) + end) end) describe('TUI FocusGained/FocusLost', function() |