Unnecessarily using bash to run command seems to make a zombie process sometimes. Process.kill can't stop that process and Process.waitpid(pid) waits forever. I don't know why.
PTY.spawn(command); pty_output.winsize = [h, w] is enough.
It is better to set winsize BEFORE process spawns (this pull request sets winsize AFTER spawn) but it looks working, it's simple, and it solves a problem.
How to reproduce
Use #10 in IRB and Reline's rendering test
Modify the test code to make it pass with start_terminal(*args, wait: 0.001)
Run rendering test again with wait: 0.0001
I have no idea why it is reproducible only with very short wait time.
Unnecessarily using
bash
to run command seems to make a zombie process sometimes.Process.kill
can't stop that process andProcess.waitpid(pid)
waits forever. I don't know why.PTY.spawn(command); pty_output.winsize = [h, w]
is enough.It is better to set winsize BEFORE process spawns (this pull request sets winsize AFTER spawn) but it looks working, it's simple, and it solves a problem.
How to reproduce
start_terminal(*args, wait: 0.001)
wait: 0.0001
I have no idea why it is reproducible only with very short wait time.