gnome-terminal shrinks window to nothing

Bug #1714810 reported by Jon Watte
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gnome-terminal (Ubuntu)
New
Undecided
Unassigned

Bug Description

Using Ubuntu 17.04, vim, in gnome-terminal. Default everythings from the desktop install, default Theme. The only change is the default window size in the settings -- I have it at 149x48. This bug happens even with the default 80x24 window size. The font is the default (not overridden) Monospace Regular 12.

When running vim in gnome-terminal, there is an ugly margin of terminal-background color on the right/bottom of the terminal window. My vim background is gray, my terminal background is green, vim displays gray background but there is a green border just slightly slimmer than one character cell on the right/bottom. This also happens for other terminal programs (including the shell) if they set the background color of output.

In an attempt to at least make this less ugly, I tried to add some padding to the terminal to center the drawable area that vim paints with the background. I added the following to my gtk.css:

    $ cat .config/gtk-3.0/gtk.css
    vte-terminal {
        padding: 8px 8px 5px 1px;
    }

Now, when I open gnome-terminal, it keeps resizing itself to be shorter in the Y axis, one line at a time, until it is only one line high. It's almost like an animation of the window height, collapsing the window to be very short. After it stops there, I can manually snap the terminal to top/bottom edges of the screen, and it will stay there, but trying to resize it will just keep shrinking the height.

This bug is about the resizing behavior. My totally uneducated guess is that there's some off-by-one error when allocating space for the terminal window contents. Terminal calculates contents, sets the window, measures contents, decides to attempt to "snap" to size of character cell, rounds down, window gets shorter, terminal measures contents, decides to attempt to "snap" to size of character cell, rounds down, window gets shorter, ...

If that is, indeed, the case, then the other bug (the ugly border) may be caused by the same problem, but I will file a separate bug for that.

    $ lsb_release -rd
    Description: Ubuntu 17.04
    Release: 17.04

    $ apt-cache policy gnome-terminal
    gnome-terminal:
      Installed: 3.20.2-1ubuntu8
      Candidate: 3.20.2-1ubuntu8

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

You're using Unity7 as far as I tell from the video, is that correct?

I couldn't yet reproduce your problem, but I'll keep trying with some different settings.

Could you please try with something "symmetrical" such as "8px 8px 5px px" as well as "8px 8px 1px 1px"? This could help us locate whether the horizontal and vertical paddings are mixed up somewhere in the source, causing the problem.

"there is an ugly margin of terminal-background color on the right/bottom of the terminal window" - Do you even have it without adding a custom padding, and with non-fullscreen non-maximized terminal? If so, that's probably related to the bug.

Revision history for this message
Jon Watte (jwatte) wrote :

Thanks for your answer!

Yes, the ugly margin is there even when not maximizing the terminal and even when not using a css override file. (I removed the css override so I can keep working.)
I'm attaching a screen shot (the ugly border is only on the right side, probably scroll bar related?)

Also worthy of note (sorry, spaced on this last time): I installed this as Ubuntu Server, and then added the desktop by doing sudo apt install ubuntu-desktop. I have also installed the NVIDIA CUDA tools, which installs the NVIDIA 375 driver.
Interestingly, my control panels don't have any option to select default window chrome sizes or font sizes, although the Terminal application itself does. I wonder if ubuntu-desktop doesn't actually include *everything* it needs. (I also noted that gnome-screenshot wasn't installed by default; I had to install it manually.)

The version of ubuntu-desktop is 1.379 and the version of unity is 7.5.0+17.04.20170407.1-0ubuntu1

Regarding "symmetric" margins, the following padding does NOT cause the problem:
padding: 1px 1px 1px 1px;
The following padding DOES cause the problem:
padding: 2px 1px 1px 1px;

Revision history for this message
Jon Watte (jwatte) wrote :

Output of "lshw"

Revision history for this message
Jon Watte (jwatte) wrote :

output of "dpkg -l"

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

I suspect that you're facing the bug that was fixed here:
https://git.gnome.org/browse/vte/commit/?id=5bc6b3f

I wasn't clear about what I meant with "symmetric" margin. My wording was clearly unfortunate, and even my example was incorrect :) I meant where swapping the X and Y axes doesn't change anything, that is, top == left and bottom == right, for example "8px 5px 5px 8px".

Apparently, as per the fix, probably you can loosen this up a bit, and any setting where left+right == top+bottom should work correctly I believe. The bug arises when the overall vertical padding differs from the overall horizontal padding.

Could you please confirm these?

If that's the case, you can:
- choose such paddings for now,
- wait for Artful which will ship vte-0.48 that fixes this,
- or recompile vte2.91 with this patch.

(The scrollback on the right is another story, unfortunately it's hard to tell from a screenshot where the right paddings ends and the scrollbar begins.)

Revision history for this message
Jon Watte (jwatte) wrote :

Thanks for the pointer!

The window in the screen shot is taken with zero configured padding. The green strip between the gray vim background and the orange scroll bar is all ugly padding added by gnome-terminal.

It sounds from your description as if the real problem is in "vte" which is used by gnome-terminal?
Note that, in the worst of cases, when I maximize a window and get a green border on the bottom, I will sometimes get a line of text "stuck" there, and it's inaccessible by any normal editor commands or cursor movement. I can't reproduce this on demand (yet) though.

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

We're talking about multiple bugs here.

The most serious one, the window automatically shrinking should I believe stop when you specify paddings so that left+right = top+bottom. Could you please test/confirm this?

> The window in the screen shot is taken with zero configured padding.

The default padding is 1px on all sides, that tiny thin line that you can see. Don't set it to 0px because you'll face new bugs then :)

The extra amount on the right side in the screenshot is probably part of the scrollbar (even though it doesn't look so). I hate it, see https://bugzilla.gnome.org/show_bug.cgi?id=772134#c3 for a workaround.

> It sounds from your description as if the real problem is in "vte" which is used by gnome-terminal?

Exactly. (Ubuntu package name is "libvte-2.91-0" and friends, source package is "vte2.91".)

> Note that, in the worst of cases, when I maximize a window and get a green
> border on the bottom, I will sometimes get a line of text "stuck" there, and
> it's inaccessible by any normal editor commands or cursor movement. I can't
> reproduce this on demand (yet) though.

When you maximize or fullscreen, extra padding might appear on the right and bottom for the remaining area that's smaller than a full cell. That area cannot be used normally. An exception is that if you begin to scroll back with the scrollbar (or touchpad, mouse wheel etc.) then the bottom extra padding also begins to show contents (this is new as of vte-0.44, the version that you have).

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

Regarding the scrollbar and its surrounding space that looks like padding: see my opinion (which is not in favor of Ubuntu's custom change at all) at https://bugzilla.gnome.org/show_bug.cgi?id=754796 comments 17-20.

Revision history for this message
Jon Watte (jwatte) wrote :

I already confirmed the "non-symmetric" behavior:

> the following padding does NOT cause the problem:
> padding: 1px 1px 1px 1px;
> The following padding DOES cause the problem:
> padding: 2px 1px 1px 1px;

Regarding scrollbars with un-filled space, I guess Linux will keep sucking on the desktop for the foreseeable future for political reasons :-)

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.