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

Any way of knowing if ttyd is running a process? #1009

Closed
abhijit-hota opened this issue Oct 28, 2022 · 3 comments
Closed

Any way of knowing if ttyd is running a process? #1009

abhijit-hota opened this issue Oct 28, 2022 · 3 comments
Labels

Comments

@abhijit-hota
Copy link

I'd like to check if ttyd is currently "busy" or "free" to take any commands.

@tsl0922
Copy link
Owner

tsl0922 commented Oct 29, 2022

I think you are talking about process insides a shell?

No. ttyd is a tty io forwarder, you can't konw if a process is exited with the input/output data.

the only way to know if a process is exited is to wait it, this is done by the shell.

@tsl0922 tsl0922 closed this as completed Oct 29, 2022
@abhijit-hota
Copy link
Author

Thanks for the response!

I think you are talking about process insides a shell?

Yep.

the only way to know if a process is exited is to wait it

Got it. Thanks for the pointer.

If I'm running ttyd via a browser automation tool and want to get the pid of a process that I executed inside ttyd, how do you suggest I go about it?

@tsl0922
Copy link
Owner

tsl0922 commented Oct 29, 2022

you can use $! to get the last command's pid in a shell sessoin, otherwise no direct way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants