Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PTY.swawn without using bash and stty #11

Merged
merged 1 commit into from
Sep 16, 2024

Conversation

tompng
Copy link
Member

@tompng tompng commented Sep 6, 2024

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

  1. Use Better assertion with less wait time #10 in IRB and Reline's rendering test
  2. Modify the test code to make it pass with start_terminal(*args, wait: 0.001)
  3. Run rendering test again with wait: 0.0001

I have no idea why it is reproducible only with very short wait time.

@tompng tompng marked this pull request as ready for review September 16, 2024 14:50
@tompng tompng merged commit 6f0014e into ruby:master Sep 16, 2024
9 checks passed
@tompng tompng deleted the swawn_without_bash_stty branch September 16, 2024 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants