feat(tui): query terminal for CSI u support (#18264)

On startup query the terminal for CSI u support and enable it using
the escape sequence from kitty's progressive enhancement protocol [1].

[1]: https://sw.kovidgoyal.net/kitty/keyboard-protocol/

(cherry picked from commit 797a25252c)

Co-authored-by: Gregory Anders <greg@gpanders.com>
This commit is contained in:
github-actions[bot]
2022-04-25 21:22:23 -06:00
committed by GitHub
parent aff05c5730
commit 9e5cef945a
6 changed files with 135 additions and 17 deletions

View File

@@ -52,11 +52,15 @@ describe('Command-line option', function()
if helpers.pending_win32(pending) then return end
local screen = Screen.new(40, 8)
screen:attach()
funcs.termopen({
local args = {
nvim_prog_abs(), '-u', 'NONE', '-i', 'NONE',
'--cmd', 'set noswapfile shortmess+=IFW fileformats=unix',
'-s', '-'
})
'--cmd', 'set noswapfile shortmess+=IFW fileformats=unix',
'-s', '-'
}
-- Need to explicitly pipe to stdin so that the embedded Nvim instance doesn't try to read
-- data from the terminal #18181
funcs.termopen(string.format([[echo "" | %s]], table.concat(args, " ")))
screen:expect([[
^ |
{1:~ }|