gnome-terminal window becomes one line shorter after every fullscreen/windowed cycle

Bug #1706008 reported by LGB [Gábor Lénárt]
20
This bug affects 4 people
Affects Status Importance Assigned to Milestone
gnome-terminal (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

It's 17.04 64 bit Ubuntu, wayland+gnome-shell. I have key F11 configured to toggle between fullscreen and windowed mode. Just noticed, that every time I press F11 to get full screen, then F11 to get back windowed mode, the window becomes one line shorter ... Continuing this I can hit the situation to have only a one line tall window. It's kinda annoying, since during my work I use tons of terminal windows, and I often use full screen / windowed mode switching. Now, I have to resize the window again and again before it becomes too shallow ...

ProblemType: Bug
DistroRelease: Ubuntu 17.04
Package: gnome-terminal 3.20.2-1ubuntu8
ProcVersionSignature: Ubuntu 4.10.0-28.32-generic 4.10.17
Uname: Linux 4.10.0-28-generic x86_64
ApportVersion: 2.20.4-0ubuntu4.5
Architecture: amd64
CurrentDesktop: GNOME
Date: Mon Jul 24 11:14:01 2017
InstallationDate: Installed on 2015-07-10 (744 days ago)
InstallationMedia: Ubuntu 15.04 "Vivid Vervet" - Release i386 (20150422)
SourcePackage: gnome-terminal
UpgradeStatus: Upgraded to zesty on 2017-06-20 (33 days ago)

Revision history for this message
LGB [Gábor Lénárt] (lgb) wrote :
Revision history for this message
LGB [Gábor Lénárt] (lgb) wrote :

I've just noticed: it seems it only happens if the shell prompt is colourfull. if it's not, there is no shrinking of the gnome-terminal window height when cycling between fullscreen and windowed mode ... Interesting!!

Revision history for this message
Egmont Koblinger (egmont-gmail) wrote :

If that's indeed the case then that's really truly interesting...

Revision history for this message
Marius Gedminas (mgedmin) wrote :

Duplicate of bug 1288655?

BTW I cannot confirm that not using colors fixes the issue; even if I set PS1='$ ', I still get shrinkage after repeated maximizing/restoring or fullscreening/restoring.

Revision history for this message
LGB [Gábor Lénárt] (lgb) wrote :

I don't know how to tell, but it seems the bug happens when the prompt has effect on the title of the window. What I mean here: opening a gnome-terminal with a colourful PS1 causes this. However if I ssh into another machine which does update the title of the window and the prompt does not use colour, the shrinking stops if I try fullscreen/back cycles again ... If I ssh into a machine which does have this "new" colour prompt then it continues ... If I ssh into a machine which does not effect the title bar, it does not effect the strange behaviour though. So, what I can think about there is some connection about the window bar title updating by the prompt (???) sorry, I have really no idea hot it happens :-O

Revision history for this message
LGB [Gábor Lénárt] (lgb) wrote :

So, as thinking on this, I must say, maybe this is my mis-interpretation of the problem. Maybe not the colour prompt causes this, but if I use a newer (or ssh into a newer) ubuntu box versus ssh into an older version (in both cases ssh in the window only changes the situation of "shrinking" if the window title is modified to reflect this, ie like username@machine1:~ changes into username@machine2:~ because of the ssh). I really feel bad not to be able to express this in a sane way, but it's kind of odd issue for me at least. Just changing PS1 does not change the situation for me either.

Ok, now it's even more odd, just trying to test it ... Now window shrinks by TWO lines not only one, and the behaviour I tried to describe above seems not to apply at all :-O I don't know what I can say, maybe this is a more complex issue and my assumption was only true for the given case when I last tested it ...Sorry about that.

Revision history for this message
Egmont Koblinger (egmont-gmail) wrote :

Both PS1 and PROMPT_COMMAND might be relevant, they might change e.g. the window title (like PROMPT_COMMAND probably does), and changing the window title has a slim chance of triggering some bugs. You could experiment with setting PS1 to something very simple and also unsetting PROMPT_COMMAND at the same time.

Different bash versions might behave differently. 4.3 was an "odd" (read: buggy) one in the sense that it didn't handle window resizes immediately, only when a key was pressed later. With current 4.4 the prompt is redrawn immediately upon a resize, but apparently PROMPT_COMMAND as well as $() substitutions in PS1 are not run again. Maybe in 4.2 it used to be different and maybe PROMPT_COMMAND was re-executed or something like this, I don't know.

You could also experiment with running a "cat" or "sleep 10000" or "vim" or something like these (so that bash doesn't have a word during the resize), or using zsh (let us know if that's what you're already using).

Revision history for this message
Egmont Koblinger (egmont-gmail) wrote :

We have pretty much located the bug in the upstream GNOME bugreport (and it's indeed related to setting the title). Thanks a lot, no further help is needed from you at this point.

Revision history for this message
Egmont Koblinger (egmont-gmail) wrote :

The issue is indirectly caused by setting the title from the primary prompt PS1, which is reprinted on each window resize.

You can "fix" it for yourself by removing the setting of the title from PS1 (which goes like "\[\e]0;whatever_the_new_title_is\a\]"). You can add something equivalent to PROMPT_COMMAND if you wish.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in gnome-terminal (Ubuntu):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.