Skip to content

os/exec: pause & resume the process executing command on Windows #44564

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

Closed
Purple-CSGO opened this issue Feb 24, 2021 · 2 comments
Closed

os/exec: pause & resume the process executing command on Windows #44564

Purple-CSGO opened this issue Feb 24, 2021 · 2 comments

Comments

@Purple-CSGO
Copy link

Motivation and What I've done

I'm working on a ffmpeg/x264/x265.... GUI program, and I want to have realtime control: get the progress, pause and resume the encoding process. The challange is how to pause and resume. After searching and trying, I made it on linux/macos by using signal as following:

// pause
cmd.Process.Signal(syscall.SIGTSTP)
// resume
cmd.Process.Signal(syscall.SIGCONT)

Problem and thinking

The problem is on Windows, it does not work. Can't find signals working on windows. I've searched a lot, but failed.

Then I recall that pressing PauseBreak and Enter when encoding in terminal/cmd already has the same effect, yet I've no idea how to send special keyboard hotkey events to the process which is running command in golang. I do have searching but can't find it.

Thanks in advance :)

@Purple-CSGO
Copy link
Author

btw, there is a way by using external program suspend.exe offered by ms, but it's not as clean as I want.

@seankhliao
Copy link
Member

Unlike many projects, the Go project does not use GitHub Issues for general discussion or asking questions. GitHub Issues are used for tracking bugs and proposals only.

For questions please refer to https://github.com/golang/go/wiki/Questions

@golang golang locked and limited conversation to collaborators Feb 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants