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

Using -n -f flags: pass through SIGINT (and other signals?) #36

Open
Jasha10 opened this issue Dec 31, 2022 · 1 comment
Open

Using -n -f flags: pass through SIGINT (and other signals?) #36

Jasha10 opened this issue Dec 31, 2022 · 1 comment

Comments

@Jasha10
Copy link
Contributor

Jasha10 commented Dec 31, 2022

Hi,

I want to use ts -n -f my_app to run apps in the foreground.
The use case is:

  • schedule a sequence of long-running jobs (each in its own tty)
  • be able to interact with the jobs while they are running.

For example, I might run ts -n -f python my_app.py, which runs for a long time and might sometimes want to interact with the app (e.g. if a python debugger breakpoint gets hit).

There's a problem with the -nf flags: if I press Ctrl-C to send a SIGINT signal, it causes ts to malfunction.
For example:

$ ts -nf python -q
>>> 123
123
>>>
KeyboardInterrupt
>>> $  # Sending input to the python process no longer works as expected

After sending SIGINT (pressing Ctrl-C), I it seems that standard input to the python process has been messed up.

Do you have any tips for how to work around this issue? Would it be easy to modify ts so that SIGINT (and maybe other signals) get passed through to the process that's running in the foreground?

@justanhduc
Copy link
Owner

Hey @Jasha10. Happy New Year!
In fact, all signals except for SIGPIPE should be propagated. However I was able to reproduce the bug. I will need to figure it out further to see where it goes wrong.

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

No branches or pull requests

2 participants