mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
Merge pull request #31898 from bfredl/termbomb
fix(terminal): don't crash on unprintable chars
This commit is contained in:
commit
6dd7fcaafd
@ -909,7 +909,7 @@ int vterm_screen_get_cell(const VTermScreen *screen, VTermPos pos, VTermScreenCe
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
cell->schar = intcell->schar;
|
cell->schar = (intcell->schar == (uint32_t)-1) ? 0 : intcell->schar;
|
||||||
|
|
||||||
cell->attrs.bold = intcell->pen.bold;
|
cell->attrs.bold = intcell->pen.bold;
|
||||||
cell->attrs.underline = intcell->pen.underline;
|
cell->attrs.underline = intcell->pen.underline;
|
||||||
|
@ -435,6 +435,19 @@ describe(':terminal buffer', function()
|
|||||||
]])
|
]])
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
it('handles unprintable chars', function()
|
||||||
|
local screen = Screen.new(50, 7)
|
||||||
|
feed 'i'
|
||||||
|
local chan = api.nvim_open_term(0, {})
|
||||||
|
api.nvim_chan_send(chan, '\239\187\191') -- '\xef\xbb\xbf'
|
||||||
|
screen:expect([[
|
||||||
|
{18:<feff>}^ |
|
||||||
|
|*5
|
||||||
|
{5:-- TERMINAL --} |
|
||||||
|
]])
|
||||||
|
eq('\239\187\191', api.nvim_get_current_line())
|
||||||
|
end)
|
||||||
|
|
||||||
it("handles bell respecting 'belloff' and 'visualbell'", function()
|
it("handles bell respecting 'belloff' and 'visualbell'", function()
|
||||||
local screen = Screen.new(50, 7)
|
local screen = Screen.new(50, 7)
|
||||||
local chan = api.nvim_open_term(0, {})
|
local chan = api.nvim_open_term(0, {})
|
||||||
|
Loading…
Reference in New Issue
Block a user