neovim/test/functional
ibhagwan 1d11808bfd
fix(terminal): interrupt/got_int hangs terminal (#30056)
Upon `terminal_enter`, `mapped_ctrl_c` is set in order to avoid `CTRL-C`
interrupts (which is proxied to the terminal process instead), `os_inchar`
will then test `mapped_ctrl_c` against `State` and set `ctrl_c_interrupts=false`
which prevents `process_ctrl_c` from setting `got_int=true` in a terminal
state.

However, if `got_int` is set outside of `process_ctrl_c`, e.g. via
`interrupt()`, this will hang the neovim process as `terminal_execute` will
enter an endless loop as `got_int` will never be cleared causing `safe_vgetc`
to always return `Ctrl_C`.

A minimal example reproducing this bug:
```vim
:autocmd TermEnter * call timer_start(500, {-> interrupt()})
:terminal
:startinsert
```

To fix, we make sure `got_int` is cleared inside `terminal_execute` when
it detects `Ctrl_C`.

Closes #20726

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2024-08-20 06:23:56 +08:00
..
api Merge pull request #29650 from ruuzia/fix_expression_parser_crash 2024-07-21 16:29:16 +02:00
autocmd refactor(tests): again yet more global highlight definitions 2024-08-14 14:03:34 +02:00
core fix(filetype): fix :filetype detect error with -u NONE (#29991) 2024-08-06 22:20:26 +08:00
editor fix(input): handle vim.on_key() properly with ALT and K_SPECIAL (#29677) 2024-07-13 04:14:29 +08:00
ex_cmds vim-patch:9.1.0651: ex: trailing dot is optional for :g and :insert/:append (#29946) 2024-08-02 07:52:09 +08:00
fixtures feat(lsp): vim.lsp.buf.format() supports textDocument/rangesFormatting #27323 2024-06-24 07:54:56 -07:00
legacy vim-patch:9.1.0648: [security] double-free in dialog_changed() 2024-08-03 08:25:43 +08:00
lua fix(vim.text): handle very long strings (#30075) 2024-08-17 22:28:03 -05:00
options test: improve test conventions 2024-04-23 18:17:04 +02:00
plugin fix(man): avoid setting v:errmsg (#30052) 2024-08-15 22:02:20 +08:00
provider refactor(tests): again yet more global highlight definitions 2024-08-14 14:03:34 +02:00
script fix(luacats): allow all types inside tuples 2024-06-01 12:56:43 +01:00
shada refactor(shada): rework msgpack decoding without msgpack-c 2024-08-05 11:12:44 +02:00
terminal fix(terminal): interrupt/got_int hangs terminal (#30056) 2024-08-20 06:23:56 +08:00
treesitter test: allow exec_lua to handle functions 2024-08-02 19:04:37 +01:00
ui fix(api): error properly with invalid field in nvim_open_win (#30078) 2024-08-17 23:10:27 +00:00
vimscript refactor: add assertion for v_blob in tv_ptr() (#29554) 2024-07-04 09:54:51 +08:00
example_spec.lua test: improve test conventions 2024-04-23 18:17:04 +02:00
preload.lua test: improve test conventions 2024-04-23 18:17:04 +02:00
testnvim.lua fix(scrollbind): properly take filler/virtual lines into account 2024-07-31 11:33:32 +01:00