[Aptitude-devel] Bug#822560: Bug#822560: aptitude: Pressing "q" to quit after installation leaves a black terminal

Manuel A. Fernandez Montecelo manuel.montezelo at gmail.com
Mon Apr 25 19:07:44 UTC 2016


2016-04-25 14:26 Ralf Jung:
>> Ralf Jung wrote:
>>> I am using Terminator as my terminal emulator. Since the latest update, aptitude
>>> tells me I can press "q" to Quit directly after packages have been
>>> installed. However, if I do that, the screen is left entirely blank and there is
>>> no reaction to typing.
>> How long have you waited? Aptitude is saving some states at this
>> position.
>Not sure, a couple of seconds. I'm on an SSD, so that should be enough
>to save any state. Quitting aptitude normally (from the "full" window)
>does not occur any noticeable delay.

The apparent lack of delay in the "traditional" case is because the
updates to state happen as the view gets repainted, etc, not when

(part of the delay is not saving states to disk and so on anyway, but
restoring curses to do a clean shut down -- unfortunately it has to be
done in this way).

>> Going black is what also happens if run in a screen session, but
>> actually, everything is/should be still there if scroll back.
>> At least that's for me. If I run aptitude inside an xterm, the about
>> 1.5 terminal heights of black do not appear. Reason for this "black"
>> is probably that aptitude goes back to fullscreen mode for a short
>> moment and only then exits.
>Hm, I hit "Enter" a bunch of times and also pressed some random letters.
>Nothing. Then I did Ctrl-C, and then I got a prompt (and some old
>prompts, from the "Enter") -- and the random letters were somehow
>transformed into garbage bytes most displayed with that "?"-like symbol.
>I just tried this again -- and indeed, after ~1 second, the black goes
>away and the normal terminal appears. That was after just installing one
>package, maybe it takes longer when many packages were affected? I sure
>felt like I waited at least 3 seconds before doing Ctrl-C.
>  In any case, it would be helpful if aptitude could display something
>about being busy, instead of going all black.

In my case (using konsole) it just goes blank as part of restoring
curses, then shuts down and the previous lines of the screen are
visible, without painting any extra blank lines in between.

aptitude doesn't print empty lines on purpose, so printing a message
like "Shutting down..." wouldn't help in this case -- if the extra blank
lines are printed (as far as aptitude can tell) for no apparent reason
and out of aptitude's control, then the "Shutting down..." message from
aptitude would disappear from the visible part of the terminal as well
when those blank lines are printed.

So the key is to find out why the blanking of the screen happens.

Could you paste "env | sort" from the user under which you run aptitude
(removing sensitive information)?  Basically I'd like to see if some
common pattern emerges, e.g the type of TERM or something similar.

And could you try with other xterm programs?  xterm, konsole and
gnome-terminal seem to work fine.

>>> If, instead of pressing "q", I press Ctrl-C directly when I get the prompt that
>>> asks me to hit Enter, then aptitude quits just fine.
>> Nope, it then can't store some states which it only stores afterwards,
>> mostly stuff like if reinstallations were done etc.
>Oh, I see... well, that's how I quit aptitude for months already, and so
>far it kept working. ;-) But I'm actually very happy that there's now a
>more "official" and reliable way of doing this :-)

It kind of works fine, but there are oddities from time to time and
corner cases.

E.g. with #721426, if you upgrade pkgA today, then don't use aptitude
for a few days, then do "aptitude update" and "aptitude", if there was
another update to pkgA in the meantime, pkgA will be automatically
marked for upgrade -- because it didn't have time to register that the
upgrade had already happened in previous sessions, and so to remove it
from pending actions.

Manuel A. Fernandez Montecelo <manuel.montezelo at gmail.com>

More information about the Aptitude-devel mailing list