mirror of
https://github.com/neovim/neovim.git
synced 2026-02-20 02:18:31 +00:00
fix(terminal): resuming doesn't work with command in fish (#37857)
Problem: Resuming terminal process doesn't work with command in fish. Solution: Send SIGCONT to the entire process group. Use killpg() like what bash and zsh do on `fg`: https://cgit.git.savannah.gnu.org/cgit/bash.git/tree/jobs.c?id=637f5c8696a6adc9b4519f1cd74aa78492266b7f#n392877045ef899/tree/Src/jobs.c (l2674)77045ef899/tree/Src/signals.c (l538)Install fish on CI to test this.
This commit is contained in:
@@ -612,6 +612,46 @@ end)
|
||||
describe(':terminal buffer', function()
|
||||
before_each(clear)
|
||||
|
||||
it('can resume suspended PTY process running in fish', function()
|
||||
skip(is_os('win'), 'N/A for Windows')
|
||||
skip(fn.executable('fish') == 0, 'missing "fish" command')
|
||||
|
||||
local screen = Screen.new(50, 7)
|
||||
screen:add_extra_attr_ids({
|
||||
[100] = {
|
||||
foreground = Screen.colors.NvimDarkGrey2,
|
||||
background = Screen.colors.NvimLightGrey2,
|
||||
},
|
||||
[101] = {
|
||||
foreground = Screen.colors.NvimLightGrey4,
|
||||
background = Screen.colors.NvimLightGrey2,
|
||||
},
|
||||
[102] = {
|
||||
foreground = Screen.colors.NvimDarkGrey2,
|
||||
background = Screen.colors.NvimLightGrey4,
|
||||
},
|
||||
})
|
||||
command('set shell=fish termguicolors')
|
||||
command(('terminal %s -u NONE -i NONE'):format(fn.shellescape(nvim_prog)))
|
||||
command('startinsert')
|
||||
local s0 = [[
|
||||
{100:^ }|
|
||||
{101:~ }|*3
|
||||
{102:[No Name] 0,0-1 All}|
|
||||
{100: }|
|
||||
{5:-- TERMINAL --} |
|
||||
]]
|
||||
screen:expect(s0)
|
||||
feed('<C-Z>')
|
||||
screen:expect([[
|
||||
|*5
|
||||
^[Process suspended] |
|
||||
{5:-- TERMINAL --} |
|
||||
]])
|
||||
feed('<Space>')
|
||||
screen:expect(s0)
|
||||
end)
|
||||
|
||||
it('term_close() use-after-free #4393', function()
|
||||
command('terminal yes')
|
||||
feed('<Ignore>') -- Add input to separate two RPC requests
|
||||
|
||||
Reference in New Issue
Block a user