From ce90a19abd5ba0188454574ee7691d06a4534f8a Mon Sep 17 00:00:00 2001 From: erw7 Date: Mon, 10 Jun 2019 11:22:07 +0900 Subject: 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 --- test/functional/terminal/tui_spec.lua | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) (limited to 'test/functional') 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(' #10134', function() + local screen = thelpers.screen_setup(0, '["'..nvim_prog + ..[[", "-u", "NONE", "-i", "NONE", "--cmd", "set noruler", "--cmd", ':nnoremap :echomsg "\"']]..']') + + command([[call chansend(b:terminal_job_id, "\")]]) + screen:expect([[ + {1: } | + {4:~ }| + {4:~ }| + {4:~ }| + {5:[No Name] }| + | + {3:-- TERMINAL --} | + ]]) + end) end) describe('TUI FocusGained/FocusLost', function() -- cgit