aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorGregory Anders <8965202+gpanders@users.noreply.github.com>2023-11-30 08:04:33 -0600
committerGitHub <noreply@github.com>2023-11-30 08:04:33 -0600
commit884a83049b2c33e2b3b6cc5c9c7f6bf820b24a3d (patch)
tree85eb49d678e664927ca48a107e8089d863a647e5 /test
parent01b91deec7b6113ae728ac3f7a55f64f57ddb3e0 (diff)
downloadrneovim-884a83049b2c33e2b3b6cc5c9c7f6bf820b24a3d.tar.gz
rneovim-884a83049b2c33e2b3b6cc5c9c7f6bf820b24a3d.tar.bz2
rneovim-884a83049b2c33e2b3b6cc5c9c7f6bf820b24a3d.zip
fix(tui): grow termkey's internal buffer for large escape sequences (#26309)
Some escape sequences (in particular, OSC 52 paste responses) can be very large, even unbounded in length. These can easily overflow termkey's internal buffer. In order to process these long sequences, dynamically grow termkey's internal buffer.
Diffstat (limited to 'test')
-rw-r--r--test/functional/terminal/tui_spec.lua25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/functional/terminal/tui_spec.lua b/test/functional/terminal/tui_spec.lua
index b17eed00f9..96ae0c4662 100644
--- a/test/functional/terminal/tui_spec.lua
+++ b/test/functional/terminal/tui_spec.lua
@@ -2557,6 +2557,31 @@ describe("TUI", function()
end)
end)
+ it('does not crash on large inputs #26099', function()
+ nvim_tui()
+
+ screen:expect([[
+ {1: } |
+ {4:~ }|
+ {4:~ }|
+ {4:~ }|
+ {4:~ }|
+ |
+ {3:-- TERMINAL --} |
+ ]])
+
+ feed_data(string.format('\027]52;c;%s\027\\', string.rep('A', 8192)))
+
+ screen:expect{grid=[[
+ {1: } |
+ {4:~ }|
+ {4:~ }|
+ {4:~ }|
+ {4:~ }|
+ |
+ {3:-- TERMINAL --} |
+ ]], unchanged=true}
+ end)
end)
-- See test/unit/tui_spec.lua for unit tests.