terminal size shrinks on dynamic title change
Submitted by Alexey Spiridonov
Link to original bug (#144066)
Description
I think this is very similar to bug 83698, so you may want to read it as background. Also, I my patch may be of some use there.
This happens because Pango can alter the height of the notebook tab labels depending on the glyphs present. In particular, this happens when a font doesn't have the required glyph, and another is substituted in its stead.
Here's my specific set-up: My default GNOME/GTK font is BitStream Vera (aliased as Sans). It doesn't have Cyrillic characters (not the version I have anyway). So, Pango substitutes Verdana from the MS-fonts collection. My DPI is set to 100x100, and the labels use font size 10. Pango requires 17 pixels for Vera, and 19 pixels for Verdana under these conditions.
User scenario:
-
open gnome-terminal
-
Edit Current Profile->Title and Command
-
make sure that dynamic title is set to something like "Replaces Initial Title" (is displayed at least)
-
set PROMPT_COMMAND='echo -ne "\033]0;[${USER}] ${PWD}\007"' so that the terminal is named in a useful way.
-
Make sure you're in some directore that has a fully latin path.
-
mkdir "some cyrillic characters". For the cyrillic-impaired: bash$ mkdir $(echo $'\346\331' | iconv -f KOI8-R -t
locale -k charmap | cut -d\" -f 2
) This should create a directory with a two-character name. The first looks like a capital Phi, the next like an upside down p plus a bar. It's irrelevant whether your terminal font can display them. What's more important is that pango be able to find the glyphs. To check: -
cd "some cyrillic characters", or, again: bash$ cd $(echo $'\346\331' | iconv -f KOI8-R -t
locale -k charmap | cut -d\" -f 2
) The title should now update to reflect this. If your system font settings are as mine (where different fonts are used for Latin and Cyrillic), you will have noticed that your terminal shrunk by one line. For a bit of fun: -
cd ..
-
cd "some cyrillic characters"
-
go to step 7 until bored (or minimum terminal size is reached)
CONCLUSION: This is an annoyingbug, since it can lead you to lose terminal area, and stuff that was written in it. Moreover, it makes you have to resize the terminal back.
If you have trouble reproducing it, please tell me/ask.
I'm attaching a patch. It includes some comments on how this happens.
Version: 2.6.x
Resolution: RESOLVED OBSOLETE