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

bug: cannot suspend bubbletea process #497

Open
knz opened this issue Oct 7, 2022 · 5 comments · May be fixed by #500
Open

bug: cannot suspend bubbletea process #497

knz opened this issue Oct 7, 2022 · 5 comments · May be fixed by #500
Labels
enhancement New feature or request

Comments

@knz
Copy link
Contributor

knz commented Oct 7, 2022

In unix shells it's expected that a terminal program suspends itself when the user pressses Ctrl+Z (which sends the signal SIGTSTP to the process).

However, bubbletea disables this terminal feature which results in Ctrl+Z becoming ineffective.

In bubbline, we're solving this by using this key handler.

However this is cumbersome, and should be handled inside bubbletea directly, perhaps controlled by a top level program option.

cc @muesli

@knz
Copy link
Contributor Author

knz commented Oct 7, 2022

NB: if you're interested I could pull the functionality out of bubbline into a PR for bubbletea. Let me know.

@muesli
Copy link
Member

muesli commented Oct 7, 2022

Agreed, since we already have a default signal handler, we should probably strive to support SIGTSTP as well.

@knz
Copy link
Contributor Author

knz commented Oct 7, 2022

since we already have a default signal handler, we should probably strive to support SIGSTP as well.

It's the other way around: the process does not handle SIGTSTP itself (the kernel does). However, Ctrl+Z should send SIGTSTP to the process.

I'll send a PR.

@muesli
Copy link
Member

muesli commented Oct 7, 2022

I'm aware of that, I just meant we are already providing "extra convenience" like a default signal handler, so it probably makes sense to complete the signal handling. On a slightly related note, I'm currently making the signal handler optional, and I'm wondering if the same option flag should also affect SIGTSTP / SIGQUIT handling then.

@knz
Copy link
Contributor Author

knz commented Oct 7, 2022

SIGTSTP only works if the process does not catch it in its signal handler. So I think the existing signal handling is fine to support suspend properly.

@knz knz linked a pull request Oct 7, 2022 that will close this issue
@muesli muesli added the enhancement New feature or request label Oct 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants