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 207 - Quick menu to change terminal size
Quick menu to change terminal size
Status: RESOLVED FIXED
Product: gnome-terminal
Classification: Core
Component: general
unspecified
Other other
: Normal enhancement
: ---
Assigned To: GNOME Terminal Maintainers
GNOME Terminal Maintainers
: 727797 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 1999-02-16 13:10 UTC by Scott Hutton
Modified: 2014-04-08 11:19 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
patch to add the functions/callbacks for the quick size options (4.02 KB, patch)
2008-09-27 14:51 UTC, Ian Hands
needs-work Details | Review
patch to add the quick size options to view menu (543 bytes, patch)
2008-09-27 14:52 UTC, Ian Hands
none Details | Review
A cleaner terminal-window patch, for qucik sizes. (3.02 KB, patch)
2008-09-28 14:14 UTC, Ian Hands
none Details | Review
simplified patch (3.27 KB, patch)
2008-09-30 13:53 UTC, Christian Persch
none Details | Review

Description Scott Hutton 2001-01-27 20:15:56 UTC
Package: gnome-core
Version: 0.99.7
Severity: wishlist

IRIX's "xwsh" has a third-button menu that includes a "Size" submenu,
which contains a few popular sizes for terminal windows (80x24, 132x24,
80x43, and 132x43, if memory serves).  Very handy when you've just
stretched your window out to view something and need to restore it to
something sane, but don't have window size feedback from your window
manager (or are just too lazy to try to get it back to the right size).

"xwsh" also uses an arrow cursor instead of an I-bar.  I tend tp prefer
an arrow.  Perhaps this could be changed under the "General" preferences,
as well.

Would love to see these features in gnome-terminal.

 -Scott Hutton, Lead Security Engineer
  Information Technology Security Office, Indiana University
  For PGP Key:  https://www.itso.iu.edu/staff/shutton/




------- Additional Comments From jacob@helixcode.com 2000-05-02 19:41:05 ----

Subject: fixed
From: Jacob Berkman <jacob@helixcode.com>
To: 207-close@bugs.gnome.org
Message-Id: <87g0s0cyge.fsf@bron-yr-aur.helixcode.com>
Date: 02 May 2000 19:41:05 -0400

This was fixed with gnome-core 1.1.8.

Jacob
-- 
"Is this love... or just confusion?"  -- Jimi Hendrix




------- Bug moved to this database by debbugs-export@bugzilla.gnome.org 2001-01-27 15:15 -------
This bug was previously known as bug 207 at http://bugs.gnome.org/
http://bugs.gnome.org/show_bug.cgi?id=207
Originally filed under the gnome-core product and gnome-terminal component.

The original reporter (shutton@pobox.com) of this bug does not have an account here.
Reassigning to the exporter, debbugs-export@bugzilla.gnome.org.
Reassigning to the default owner of the component, gnome-core-maint@bugzilla.gnome.org.

Comment 1 Scott Hutton 2002-04-18 05:51:59 UTC
Perhaps the wrong bug was closed?  This feature isn't implemented as
of at least gnome-core-1.4.0.6.

I am the original reporter, though that information appears to have
been lost in a Bugzilla DB export.
Comment 2 Kjartan Maraas 2002-04-20 19:25:36 UTC
I think you're right. Reopening and moving to 2.0.x as RFE.
Comment 3 Havoc Pennington 2002-06-15 18:07:27 UTC
Should also be quick menu option to change the font scale factor
(this would not change the font preference, but would apply 
a per-terminal-window scale factor to the fonts).

I don't think the cursor preference is useful enough to make it 
into the preferences dialog - there are already two dozen requests
preferences in here that sound more useful, and the prefs dialog 
is already full so there's nowhere to put those two dozen.
Comment 4 gnome.org 2004-03-17 17:21:54 UTC
How 'bout at least something I can stick in a conf file somewhere to
override the default size without editing code and recompiling?
Comment 5 Danielle Madeley 2006-07-24 16:02:24 UTC
It's worth noting that the terminal size was 132x45, not 132x43.
Comment 6 Thomas D Ahle 2008-03-08 23:31:17 UTC
Well, if you always have the same terminal size, you can get stressed by an extra column.
What about having a size in the profile, and a menu item in the View menu resetting to that value?
Comment 7 Gil Forcada 2008-09-08 14:52:49 UTC
With View → Zoom in/out this can be achieved perfectly.

Should it be closed?
Comment 8 Ross Golder 2008-09-09 02:03:05 UTC
No, this ticket isn't about changing the size of the fonts, it's about changing how many rows/columns of characters are displayed in the terminal (without using the mouse to resize it, and assuming you're not technical enough to use the --geometry and -x switches on the command line or in a .desktop!).

IMHO, I'd like to see the GNOME terminal profile settings have a 'default terminal size' pulldown with '80x25' (default), '80x...', '132x...' (the common/standard favourites) and 'custom'. I think this is probably what the OP, Scott, wanted too when he posted this report back in '99 :) Still a valid and open ticket, AFAICS.
Comment 9 Ian Hands 2008-09-27 14:51:36 UTC
Created attachment 119478 [details] [review]
patch to add the functions/callbacks for the quick size options
Comment 10 Ian Hands 2008-09-27 14:52:28 UTC
Created attachment 119479 [details] [review]
patch to add the quick size options to view menu
Comment 11 Ian Hands 2008-09-27 14:55:29 UTC
80x24, 80x43, 134x24, 134x43 ??

I would LOVE to contribute to this wonderful project. Could I get my name/email included somewhere? Let me know if this is what was you were looking for.

The above patches apply to gnome-terminal-2.24.0.

Thanks,
-Ian Page Hands
Comment 12 Diego Escalante Urrelo (not reading bugmail) 2008-09-28 05:06:02 UTC
Comment on attachment 119478 [details] [review]
patch to add the functions/callbacks for the quick size options

Hey!

thanks for the patch, there come some picky comments about it:

>--- old/terminal-window.c	2008-09-27 10:31:09.000000000 -0400
>+++ new/terminal-window.c	2008-09-27 10:30:38.000000000 -0400
>@@ -62,6 +62,7 @@ struct _TerminalWindowPrivate
>   TerminalScreen *active_screen;
>   int old_char_width;
>   int old_char_height;
>+

? blank line?

>   void *old_geometry_widget; /* only used for pointer value as it may be freed */
>   char *startup_id;
> 
>@@ -148,6 +149,19 @@ static void view_zoom_out_callback      
>                                                TerminalWindow *window);
> static void view_zoom_normal_callback         (GtkAction *action,
>                                                TerminalWindow *window);
>+
>+/*Q_Size*/

Use a more descriptive name, /* Quick size menu */ perhaps. Same with other instances of this comment.

>+static void view_quick_size_80_24_callback         (GtkAction *action,
>+						    TerminalWindow *window);
>+static void view_quick_size_80_43_callback         (GtkAction *action,
>+						    TerminalWindow *window);
>+static void view_quick_size_132_24_callback         (GtkAction *action,
>+						    TerminalWindow *window);
>+static void view_quick_size_132_43_callback         (GtkAction *action,
>+						    TerminalWindow *window);
>+static void change_quick_size         (TerminalWindow *window, guint q_width, guint q_height);
>+
>+
> static void terminal_set_title_callback       (GtkAction *action,
>                                                TerminalWindow *window);
> static void terminal_add_encoding_callback    (GtkAction *action,
>@@ -1377,7 +1391,36 @@ terminal_window_init (TerminalWindow *wi
>       { "ViewZoom100", GTK_STOCK_ZOOM_100, NULL, "<control>0",
>         NULL,
>         G_CALLBACK (view_zoom_normal_callback) },
>-
>+      

Free tab in the + line.

>+      /*Q_Size*/
>+      { "132x43_QuickSize", 
>+	NULL,
>+	N_("_132x43"),
>+	NULL,
>+	NULL,
>+	G_CALLBACK (view_quick_size_132_43_callback) },
>+
>+      { "132x24_QuickSize", 
>+	NULL,
>+	N_("13_2x24"),
>+	NULL,
>+	NULL,
>+	G_CALLBACK (view_quick_size_132_24_callback) },
>+      
>+      { "80x43_QuickSize", 
>+	NULL,
>+	N_("80x4_3"),
>+	NULL,
>+	NULL,
>+	G_CALLBACK (view_quick_size_80_43_callback) },
>+
>+      { "80x24_QuickSize", 
>+	NULL,
>+	N_("80x2_4"),
>+	NULL,
>+	NULL,
>+	G_CALLBACK (view_quick_size_80_24_callback) },
>+      
>       /* Terminal menu */
>       { "TerminalProfiles", NULL, N_("Change _Profile") },
>       { "TerminalSetTitle", NULL, N_("_Set Title…"), NULL,
>@@ -1477,6 +1520,7 @@ terminal_window_init (TerminalWindow *wi
>         G_CALLBACK (view_fullscreen_toggled_callback),
>         FALSE }
>     };
>+

Free line!

>   TerminalWindowPrivate *priv;
>   TerminalApp *app;
>   GtkActionGroup *action_group;
>@@ -1556,6 +1600,7 @@ terminal_window_init (TerminalWindow *wi
>                                        toggle_menu_entries,
>                                        G_N_ELEMENTS (toggle_menu_entries),
>                                        window);
>+

Free line

>   gtk_ui_manager_insert_action_group (manager, action_group, 0);
>   g_object_unref (action_group);
> 
>@@ -2928,6 +2973,52 @@ view_zoom_normal_callback (GtkAction *ac
> }
> 
> static void
>+view_quick_size_80_24_callback (GtkAction *action,
>+				TerminalWindow *window)
>+{
>+  change_quick_size(window, 80, 24);
>+}
>+
>+static void
>+view_quick_size_80_43_callback (GtkAction *action,
>+				TerminalWindow *window)
>+{
>+  change_quick_size(window, 80, 43);
>+}
>+
>+static void
>+view_quick_size_132_24_callback (GtkAction *action,
>+				 TerminalWindow *window)
>+{
>+  change_quick_size(window, 132, 24);
>+}
>+
>+static void
>+view_quick_size_132_43_callback (GtkAction *action,
>+				 TerminalWindow *window)
>+{
>+  change_quick_size(window, 132, 43);
>+}
>+
>+/*Q_Size*/
>+static void
>+change_quick_size (TerminalWindow *window, guint q_width, guint q_height)
>+{

Just use width, height. Those vars in a completely clean context, so no problem to use "simple" names.

>+  TerminalWindowPrivate *priv = window->priv;
>+  
>+  if (priv->active_screen == NULL)
>+    return;
>+
>+  TerminalScreen *screen =  priv->active_screen;
>+  gboolean even_if_mapped = TRUE;
>+  

Wouldn't TRUE directly in the function below work?

>+  //g_printerr("%dx%d\n", q_width, q_height);

Remove the comments :)

>+
>+  terminal_window_set_size_force_grid (window, screen, even_if_mapped, q_width, q_height);
>+}
>+
>+

Picky!, free line.

>+static void
> terminal_set_title_dialog_response_cb (GtkWidget *dialog,
>                                        int response,
>                                        TerminalScreen *screen)


Please update it for a second review, it looks good so far, Christian should be able to give a more authorized opinion on that though ;).
Comment 13 Ian Hands 2008-09-28 14:09:37 UTC
Comment on attachment 119478 [details] [review]
patch to add the functions/callbacks for the quick size options

--- old/terminal-window.c	2008-09-27 20:25:51.000000000 -0400
+++ new/terminal-window.c	2008-09-28 10:06:44.000000000 -0400
@@ -148,6 +148,16 @@ static void view_zoom_out_callback      
                                                TerminalWindow *window);
 static void view_zoom_normal_callback         (GtkAction *action,
                                                TerminalWindow *window);
+static void view_quick_size_80_24_callback    (GtkAction *action,
+					       TerminalWindow *window);
+static void view_quick_size_80_43_callback    (GtkAction *action,
+					       TerminalWindow *window);
+static void view_quick_size_132_24_callback   (GtkAction *action,
+					       TerminalWindow *window);
+static void view_quick_size_132_43_callback   (GtkAction *action,
+					       TerminalWindow *window);
+static void change_quick_size                 (TerminalWindow *window,
+					       guint width, guint height);
 static void terminal_set_title_callback       (GtkAction *action,
                                                TerminalWindow *window);
 static void terminal_add_encoding_callback    (GtkAction *action,
@@ -1377,6 +1387,30 @@ terminal_window_init (TerminalWindow *wi
       { "ViewZoom100", GTK_STOCK_ZOOM_100, NULL, "<control>0",
         NULL,
         G_CALLBACK (view_zoom_normal_callback) },
+      { "132x43_QuickSize", 
+	NULL,
+	N_("_132x43"),
+	NULL,
+	NULL,
+	G_CALLBACK (view_quick_size_132_43_callback) },
+      { "132x24_QuickSize", 
+	NULL,
+	N_("13_2x24"),
+	NULL,
+	NULL,
+	G_CALLBACK (view_quick_size_132_24_callback) },
+      { "80x43_QuickSize", 
+	NULL,
+	N_("80x4_3"),
+	NULL,
+	NULL,
+	G_CALLBACK (view_quick_size_80_43_callback) },
+      { "80x24_QuickSize", 
+	NULL,
+	N_("80x2_4"),
+	NULL,
+	NULL,
+	G_CALLBACK (view_quick_size_80_24_callback) },
 
       /* Terminal menu */
       { "TerminalProfiles", NULL, N_("Change _Profile") },
@@ -2928,6 +2962,46 @@ view_zoom_normal_callback (GtkAction *ac
 }
 
 static void
+view_quick_size_80_24_callback (GtkAction *action,
+				TerminalWindow *window)
+{
+  change_quick_size(window, 80, 24);
+}
+
+static void
+view_quick_size_80_43_callback (GtkAction *action,
+				TerminalWindow *window)
+{
+  change_quick_size(window, 80, 43);
+}
+
+static void
+view_quick_size_132_24_callback (GtkAction *action,
+				 TerminalWindow *window)
+{
+  change_quick_size(window, 132, 24);
+}
+
+static void
+view_quick_size_132_43_callback (GtkAction *action,
+				 TerminalWindow *window)
+{
+  change_quick_size(window, 132, 43);
+}
+
+static void
+change_quick_size (TerminalWindow *window, guint width, guint height)
+{
+  TerminalWindowPrivate *priv = window->priv;
+  if (priv->active_screen == NULL)
+    return;
+
+  TerminalScreen *screen =  priv->active_screen;
+  gboolean even_if_mapped = TRUE;
+  terminal_window_set_size_force_grid (window, screen, even_if_mapped, width, height);
+}
+
+static void
 terminal_set_title_dialog_response_cb (GtkWidget *dialog,
                                        int response,
                                        TerminalScreen *screen)
Comment 14 Ian Hands 2008-09-28 14:14:37 UTC
Created attachment 119532 [details] [review]
A cleaner terminal-window patch, for qucik sizes.

DOH! I clicked edit and edited the comment!

We like clean patches eh? Sorry I just patched from a file that I was editing all over... This one should be cleaner. I just went ahead and removed the /*Q_change*/ comments as they were there merely for my reference. 

Let me know if this works.
Thanks,
-Ian Page Hands
Comment 15 Christian Persch 2008-09-30 13:53:51 UTC
Created attachment 119650 [details] [review]
simplified patch

Thanks for the patch! I simplified it a bit.

However there's a problem: when in maximised or fullscreen mode, changing the terminal size doesn't work.
Which behaviour should we apply in this case? Either
- demaximise/unfullscreen and set the specified size, or
- change the font scale so that the terminal has the specified size despite being maximised/fullscreened.
Comment 16 Ian Hands 2008-09-30 14:15:41 UTC
Cool I new there was a way to get the width/height data to the callback in a convenient fashion (I tired radio buttons, but their mechanics did not make since). I kept thinking something like reflection in Java could get some usable information from the caller.... guess I had the getname part right in my head.

"- demaximise/unfullscreen and set the specified size, or"
"- change the font scale so that the terminal has the specified size despite"

I kind of like how nothing happens when in fullscreen, but for the sake of consistency you are right. What about just disabling (greyed out) options when the terminal is fullscreen? I wonder what the original poster's idea would be.
Comment 17 Michael Trausch 2008-10-08 06:18:50 UTC
I think that perhaps the font size should change when in fullscreen mode; this would be consistent with the way Terminal handles C-+ when the window cannot expand anymore.

Also, one comment on the screen sizes; 25 lines is the default for most terminals (particularly in the world of VGA consoles).  25 is a reasonable minimum I think.  Also, though I cannot think of any at the moment, I know that I have run into at least a few terminal-based applications which _assumed_ they were running in a 25 line, 80 character terminal.  They'll display fine in a larger terminal (though they won't take up the full terminal real estate), but they won't do so well in a smaller terminal.  So, instead of 24 lines, could it be 25?

Comment 18 Christian Persch 2008-10-09 12:37:56 UTC
I committed a patch based on the one provided here; thanks again for the patch!

Davyd: Re comment 5: I was unable to find information supporting the 45 lines, all documents I found mentioned 80 or 132 column by 43 lines.

And re comment 17: 24 seems to have been the standard size, and also vte defaults to 80x24.

Closing this bug; I'm opening a new one for defining the fullscreen/maximised behaviour with terminal size switching.
Comment 19 Amit 2014-04-08 11:19:40 UTC
*** Bug 727797 has been marked as a duplicate of this bug. ***