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

Does Suspend require any special screen handling? #779

Open
m-kru opened this issue Feb 9, 2025 · 0 comments
Open

Does Suspend require any special screen handling? #779

m-kru opened this issue Feb 9, 2025 · 0 comments

Comments

@m-kru
Copy link

m-kru commented Feb 9, 2025

System: Linux riis 6.8.0-52-generic #53~22.04.1-Ubuntu

I have the following code snippet in my application for suspension.

	err := screen.Suspend()
	if err != nil {
		return fmt.Errorf("suspend: %v", err)
	}

	err = syscall.Kill(syscall.Getpid(), syscall.SIGSTOP)
	if err != nil {
		return fmt.Errorf("suspend: %v", err)
	}

	err = screen.Resume()
	if err != nil {
		return fmt.Errorf("suspend: %v", err)
	}

However, it sometimes works incorrectly. After bringing the application back, using the fg command, I lose control over my application. Sometimes the screen displays half of the shell session and half of my application. Sometimes, I can see pressed key in the right down corner of the screen. The behavior is not deterministic, and I lack ideas how to debug this issue. I have tested this on multiple terminal emulators, and the behavior is buggy in all of them.

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

1 participant