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

Unusual state after suspend #563

Open
robert-ross opened this issue Aug 30, 2024 · 1 comment
Open

Unusual state after suspend #563

robert-ross opened this issue Aug 30, 2024 · 1 comment

Comments

@robert-ross
Copy link

With less 643 and earlier, pressing Control-Z after running echo test | less +Gg in bash immediately switches from the alternate to the normal screen. With less 661, the user remains on the alternate screen after pressing Control-Z and must then press another key to see the normal screen. After returning to less via fg, Control-Z works as expected. Also, in all versions, pressing Control-Z after running echo test | less works as expected.

gwsw added a commit that referenced this issue Aug 30, 2024
getccu calls getchr which calls iread.
When ctrl-Z (SIGTSTP) is entered, iread sets sigs |= S_STOP
and returns READ_INTR. getchr then also returns READ_INTR.
As of 2d0abe8, getccu converts any negative value like READ_INTR
to a null char, which causes getccu to ignore the char and call
getchr again. Before 2d0abe8 we would retain the negative char
and exit the loop, but the char value was not used because the
fact that sigs is set would be checked first. It seems more
straightforward to just exit the getccu loop when sigs is set.

Related to #563.
@gwsw
Copy link
Owner

gwsw commented Aug 30, 2024

Fixed in 2bfad47.

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

No branches or pull requests

2 participants