GNOME Bugzilla – Bug 548322
gnome-terminal doesn't resize on `ESC [ 8' or `ESC [ 4' despite vte's resize_window()
Last modified: 2008-10-09 11:58:29 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,
Should be easy to hook up the resize-window signal.
Created attachment 117177 [details] [review] Patch for this bug
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?
Created attachment 117219 [details] [review] corrected patch add disconnected signal code & use terminal_window_set_size_force_grid
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.
I committed a patch based on this one. Thanks again for providing the patch!