After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 548322 - gnome-terminal doesn't resize on `ESC [ 8' or `ESC [ 4' despite vte's resize_window()
gnome-terminal doesn't resize on `ESC [ 8' or `ESC [ 4' despite vte's resize_...
Status: RESOLVED FIXED
Product: gnome-terminal
Classification: Core
Component: general
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: GNOME Terminal Maintainers
GNOME Terminal Maintainers
Depends on:
Blocks:
 
 
Reported: 2008-08-18 18:27 UTC by Pedro Villavicencio
Modified: 2008-10-09 11:58 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
Patch for this bug (1.27 KB, patch)
2008-08-22 04:36 UTC, Maxim Ermilov
needs-work Details | Review
corrected patch (1.50 KB, patch)
2008-08-22 13:40 UTC, Maxim Ermilov
needs-work Details | Review

Description Pedro Villavicencio 2008-08-18 18:27:32 UTC
this report has been filed here:

https://bugs.edge.launchpad.net/ubuntu/+source/gnome-terminal/+bug/258775

"xterm and other terminals I've tried correctly handle the standard `ESC
[ 8' and `ESC [ 4' escape sequences to alter the size of the terminal
window.

    # Sets terminal to 100x40 characters.
    $ echo -n '@[8;40;100t' | tr @ \\033
    # Sets terminal to 200x200 pixels.
    $ echo -n '@[4;200;200t' | tr @ \\033

gnome-terminal doesn't, which is wrong. This is despite vte's vteapp.c'
resize_window() which tries to handle both escape sequences. I suspect
there's something lacking in gnome-terminal to make use of this.

Not supporting these escape sequences means gnome-terminal, the default
Ubuntu terminal, is unsuitable for some legacy console apps"

Thanks,
Comment 1 Christian Persch 2008-08-21 12:39:19 UTC
Should be easy to hook up the resize-window signal.
Comment 2 Maxim Ermilov 2008-08-22 04:36:03 UTC
Created attachment 117177 [details] [review]
Patch for this bug
Comment 3 Christian Persch 2008-08-22 12:10:12 UTC
Thanks for the patch! A few comments:

You need to disconnect the signal handler in notebook_page_removed_callback.

+	GtkAllocation ScreenAllocation = gtk_widget_get_allocation (GTK_WIDGET (screen));
+	GtkAllocation WindowAllocation = gtk_widget_get_allocation (GTK_WIDGET (window));
+	int dx,dy;
+	dx = WindowAllocation.width - ScreenAllocation.width;
+	dy = WindowAllocation.height - ScreenAllocation.height;
+	gtk_window_resize (GTK_WINDOW (window), width + dx, height + dy);

I think a call to terminal_window_set_size_force_grid() would do better than this ad-hoc thing. Can you try that?
Comment 4 Maxim Ermilov 2008-08-22 13:40:43 UTC
Created attachment 117219 [details] [review]
corrected patch

add disconnected signal code
&
use terminal_window_set_size_force_grid
Comment 5 Christian Persch 2008-09-29 17:43:55 UTC
I think we need to add a check if the terminal requesting the resize is the active tab or not. Background tabs shouldn't resize the window. However, resizing while in the background should still set the size correctly so it's used when the user does switch to that tab.
Comment 6 Christian Persch 2008-10-09 11:58:29 UTC
I committed a patch based on this one. Thanks again for providing the patch!