mirror of
https://github.com/rivo/tview.git
synced 2026-04-26 13:25:51 +03:00
[GH-ISSUE #984] Doesn't revert to shell after receiving SIGTSTP #712
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tview#712
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @pafoster on GitHub (May 5, 2024).
Original GitHub issue: https://github.com/rivo/tview/issues/984
First off, thanks for developing this amazing library!
Unexpected behaviour: If I issue a
kill -s SIGTSTP $pidas a command in a separate terminal, the terminal running the UI continues to display the UI (albeit in SIGTSTPed state). Expected behaviour (seetop,linksand other utilities) is for the running process to revert to the user's shell.Related question: How do I ensure that Ctrl-Z triggers a SIGTSTP?
@rivo commented on GitHub (May 9, 2024):
I wonder if this is more of a question for
tcellthan for this project. Definitely the last question because my understanding is thattcellwill capture all user input, including Ctrl-Z. For example, this is bound to the "undo" function in aTextArea.There is
Application.Suspend()also which might help you achieve what you would like to do. And if it doesn't, please explain why/how receivingSIGTSTP(andSIGCONTalso, I assume) is something your application needs to be able to support.@pafoster commented on GitHub (May 18, 2024):
Thank you. What I'd like to achieve is to signal that the process running the tview application is suspended, taking me back to the shell from which the process was invoked. You can reproduce this effect by invoking a utility like
topin your terminal and hitting ctrl-z. What happens is that it temporarily suspends execution of the process and takes you back to the shell; if you then typefg,topwill display again and continue execution. I am providingtopas an example for what I believe is standard behaviour for job control in a Unix/Linux environment.According to https://www.gnu.org/software/libc/manual/html_node/Job-Control-Signals.html:
The typical behavior is described in this stackexchange post:
I've used Application.Suspend() successfully to invoke a sub-shell. But what I am after here as mentioned above, is to a) temporarily suspend execution on the process and b) return to the shell from which the process was invoked.
The Wikipedia article on job control says:
@pafoster commented on GitHub (Dec 8, 2024):
Closing this issue as this is likely lower-level than tview. (I've reported a possibly related issue here: https://github.com/golang/go/issues/70548)