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

Irssi terminal in inconsistent state after ignored suspend #733

Closed
ailin-nemui opened this Issue Jul 24, 2017 · 3 comments

Comments

Projects
None yet
3 participants
@ailin-nemui
Contributor

ailin-nemui commented Jul 24, 2017

When irssi is not opened from a shell, for example running as top level inside tmux/screen/urxvt, using ^Z to suspend puts irssi into an inconsistent state, probably because the terminal is never resumed (no SIGCONT) although the suspend was ignored.

Possibly related / caused by #452 (which came from discussion in #450 )

reported by Jaga

regression since 1.0.0

@ailin-nemui

This comment has been minimized.

Contributor

ailin-nemui commented Jul 26, 2017

@LemonBoy do you see any negative effects of reverting ?

@ailin-nemui ailin-nemui added the bug label Jul 26, 2017

@LemonBoy

This comment has been minimized.

Member

LemonBoy commented Jul 26, 2017

Reverting everything isn't really a solution, we should rather investigate what's wrong and try to come up with a fix.
How does one reproduce this problem?

@dequis

This comment has been minimized.

Member

dequis commented Jul 26, 2017

screen irssi (that is, launching it directly inside, without a shell in the middle) then ^Z for the default suspend keybinding. Reliably leaves the terminal config in stopped state.

The thing about #450 is that it was fixed by two tickets, #452 and #457. Both were merged for the 1.x branch, but only latter was included in 0.8.19. That didn't cause issues, but now we get this issue with people using 1.x.

And the appearance of the code deleted by #452 sounds like someone was doing something weird to workaround some not very well explained issue. And I think this issue is that we uncovered that again.

So far that's what's clear. I'm not 100% certain on the race conditions involved. Or what was fixed by #452, or how. Or its relationship with #457. I think nei has a better grasp on that, but I personally never found a way to reproduce the race condition.

ailin-nemui added a commit to ailin-nemui/irssi that referenced this issue Aug 7, 2017

Revert "Merge pull request irssi#452 from LemonBoy/terminfo-cup"
Fixes irssi#733. The fix outlined in irssi#452 had adverse effects for the
following reason. The code removed the restoration path that would go on
the code path from kill SIGTSTP. The problem is this: When Irssi is not
running in a controlling parent (like a shell), the TSTP will in fact be
ignored. In that case, there is no process sending a CONT either and
thus the screen state never gets restored. Luckily, the patch in irssi#457 is
sufficient to prevent the problem in irssi#450 (which lead to the development
of irssi#452). To that end, we do end up with potentially calling
terminfo_cont twice but that is better than not calling it at all.

This reverts commit b1ffd5f, reversing
changes made to 9cb0419.

@ailin-nemui ailin-nemui added this to the 1.0.5 milestone Jan 10, 2018

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