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#n3928
77045ef899/tree/Src/jobs.c (l2674)
77045ef899/tree/Src/signals.c (l538)

Install fish on CI to test this.
This commit is contained in:
zeertzjq
2026-02-14 10:49:39 +08:00
committed by GitHub
parent a17d39314d
commit 1a1a60bd05
4 changed files with 48 additions and 7 deletions

View File

@@ -241,7 +241,9 @@ void pty_proc_resize(PtyProc *ptyproc, uint16_t width, uint16_t height)
void pty_proc_resume(PtyProc *ptyproc)
{
kill(((Proc *)ptyproc)->pid, SIGCONT);
// Send SIGCONT to the entire process group, as some shells (e.g. fish) don't
// propagate SIGCONT to suspended child processes.
killpg(((Proc *)ptyproc)->pid, SIGCONT);
}
void pty_proc_close(PtyProc *ptyproc)