GNOME Bugzilla – Bug 78776
Show tabs even when only 1 exists
Last modified: 2015-07-14 17:43:02 UTC
Using gnome-terminal 1.9.2. When I add a second tab to it, it resizes the window to make up for the space to draw the tabs. It resizes the window downward which is awkward because it then goes below my panel. It would be very nice if gnome-terminal would resize the zvt widget to compensate for the loss of space in the gnome-terminal window. Same problem applies when closing all other tabs...gnome-terminal should grow back. It's annoying for users to have to resize their windows when tabs come and go. Thanks!
The current behavior is that adding tabs maintains the fact that the terminal is 80x24 (say) if it had that size before. I think this is really right, just as we maintain the grid size if you change the font... So I guess the current way is intentional. If a lot of people think it's a bug we could consider changing it, but I'd want to hear more rationale etc. and maybe some UI team input.
Personally, I would definitely rather have my terminal size shrink than to have to resize windows all the time. It's much easier to Shift+PgUp if something scrolled off the screen than it is to have to grab your mouse and drag the window up because the bottom of the terminal is now below your panel. I'll post the bug to the usability list with a request for comments.
I guess the simplest solution would be for gnome-terminal to show a tab even when there's only one terminal open in the window-- then there would be no need to resize the window when you opened a second tab. Admittedly this doesn't make the greatest use of screen real-estate, though.
I agree that it's probably the best solution. In fact, it's what Konsole and Multi-Gnome-Terminal have chosen to do. For people who are real minimalists, couldn't a "don't display tabs if only one tag" crackpipe option be editable via gconf-editor? Galeon and Mozilla both implement this style of preferences as "Always show tabs".
We could have "hide tabs" just like "hide menubar" I suppose, with prefs option "hide tabs by default in new windows." I sort of like the current behavior though... tabs-when-needed... The terminal _could_ pull itself out from under the panel, though I think in practice that wouldn't work very well.
I find this resizing annoying. I don't like it any time my window size changes and I didn't directly change it. When you have your window positioned just where you want it it is frustrating to have it move around. I have mine positioned at the bottom of the screen just above the panel, but when a tab is added then the bottom of the terminal window goes underneath the panel. I have noticed this same thing happens when I toggle the menubar on/off.
*** Bug 87293 has been marked as a duplicate of this bug. ***
I don't think the resizing itself is a bug. Adding/removing the tab as you go between 1 tab and > 1 may be.
*** Bug 92642 has been marked as a duplicate of this bug. ***
*** Bug 115618 has been marked as a duplicate of this bug. ***
*** Bug 120732 has been marked as a duplicate of this bug. ***
Havoc, I don't understand your last comment -- does it mean that "tabs always on" mode, perhaps with an appropriate exposed or hidden configuration key "keep tabs hidden in single-tab terminal windows", would be acceptable? If yes, I'll try to cobble up a patch, I think this is within my means.
*** Bug 133757 has been marked as a duplicate of this bug. ***
Created attachment 32148 [details] [review] Implementation for always show tabs Here is a possible implementation. If the gconf key /apps/gnome-terminal/global/always_show_tabs is true, the notebook's tabs are not hidden if there's only one tab.
Created attachment 37157 [details] [review] Javier Donaire's patch - updated. Updated Javier Donaire's patch to work with latest CVS version.
Comment on attachment 32148 [details] [review] Implementation for always show tabs Obsoleting this since there's an updated patch in.
The original request for resizing the terminal widget rather than the window when the tabs get displayed is what I'd prefer to see. Havoc, you said that "If a lot of people think it's a bug we could consider changing it". I think this is a bug. What's "a lot of people"? What would be required for the terminal to change behaviour to: 1. Don't show tabs when not needed (i.e. only one terminal in the window). 2. When tabs need to be displayed, shrink the terminal pane, keep the window size.
Will have to wait for the next development cycle now.
I aired this in #gnome-hackers today and it seems most people in that group don't think this is improvement and the argument is that most people don't use tabs at all.
I use tabs and I would like to see some of the improvements mentioned here find their way into gnome-terminal. Grabbing your mouse while typing in gnome-terminal is just to awkward.
(In reply to comment #20) > I use tabs and I would like to see some of the improvements mentioned here > find their way into gnome-terminal. Grabbing your mouse while typing in > gnome-terminal is just to awkward. What is wrong with alt-<number> or ctrl-pgdn/pgup?
I'm sorry if I wasn't clear: I mean grabbing your mouse to move your terminal window, because it resized over/under your panel when you add a second tab.
Created attachment 57588 [details] [review] Javier Donaire's patch - updated against current cvs Diff against current cvs.
Allthough I can live with a "always show tabs option", I hope one can also choose to automatically resize the terminal window.
(In reply to comment #17) > 2. When tabs need to be displayed, shrink the terminal pane, keep the window size. Some ncurses apps don't like it when the terminal is resized. For example 'iptraf' won't resize itself so you lose the bottom row, 'top' kinda borks the terminal at exit. Fix it for some, break it for others.
Not taking any position on the whole bug, but really, if applications can't deal with resizes, they should be fixed, not limit the others which work adequately.
I don't understand why this bug is such an issue as to still be open 4 years later... These are the groups of people I can tell exist: 1. I want my terminals to remain the same size. a. Don't show tabs when only one exists. When I have more than one tab, increase window size. When I have only one tab again, decrease window size. 2. I want my window to remain the same size. a. Don't show tabs when only one exists. When I have more than one tab, steal window space from the terminal for tab bar. When I have only one tab again, return window space back to the terminal. b. Always show tabs. As it stands. The current gnome-terminal (2.14) does none of these. I do not know if this bug has been fixed in 2.15, but it seems not due to the last activity on this bug being before the release of 2.14. Currently gnome-terminal does this: Don't show tabs when only one exists. When I have more than one tab, increase window size. When I have only one tab again, give window space to terminal. This satisfies nobody. In addition, the window grows each time the tab bar is added and removed. The easiest solution is just forget about the entire problem and always show tabs (group 2b). It may be noted that this happens with gedit and Gaim. The group 2a has a minor flaw. The terminal can only be certain sizes, so the stealing from the terminal will most likely not steal the perfect number of pixels for the tab bar, so the window will loose a few pixels of size. This might now be too bad, but the same will happen when the tab bar goes away. If you felt you should not ever increase the size of the terminal, then every cycle a complete line of the terminal would be lost. If it lost the extra space one way and gained it the other then overall, things would be okay. But all the same, the window size would almost be required to vary, which is exactly what this group does not want. It may be noted that this happens with Epiphany and Liferea. The group 1a has half of what they want now since the window size increases when a tab bar is added. The only thing that would be done to fix this problem is just remove the space that the title bar is using from the window. So this is very doable. So there a two opinions that can be chosen (1a and 2b), and neither of them are being used. In addition, they are not mutually exclusive. Also, patches for 2b already exist. I recommend the second part of 1a be fixed. As an added bonus, you don't have to worry about those ncurses programs. Also, you may notice the the groups would change to "don't waste space" and "don't resize my window". Or did I completely miss something? By the way, I am in group 1a. I like xterm, but I like tabs and GNOME (consistency, simplicity, GTK+, Pango, etc). All in all, choose some reason for the madness. Why does it resize the window when we add the tab bar so that the terminal stays the same, but then give the space to the terminal when it gets rid of the bar? I would be okay with 2a (assuming grow one way and shrink the other so that you don't have the window growing or shrinking over time). It just needs to be consistent.
Without reading your entire comment, if a bug is open for four years, it just means that nobody cared enough to write a patch.
Created attachment 65456 [details] [review] Fix growth of window due to tab bar disappearance I found out why the bug exists and made a patch. When a tab was removed, it causes a series of recalculation steps, but the window calculation happened before the tab bar was removed. This forces a recalculation after the tab bar is removed.
I used a GNOME 2.12 machine (Ubuntu) a little while ago and realized that it did not have the problem with the terminal growing. I now think that my problem is a 2.14 bug. So my comments on this bug are nullified but a bug may be opened to address this problem that I described and made a patch for.
Opening/closing causing an extra row is bug 324426
Just wanted to say that i'm using Javiers patch for like 1.5 years now. After applying 'Javier Donaire's patch - updated against current cvs' no unintented resizing is happening with gnome-terminal 2.14.2.
disclaimer: I almost always use at least two tabs of screen sessions, one for user and one for root. I think tabs are best used to separate profiles. I'm in favor of creating a tab toolbar. It would allow gnome-terminal to add enhancements and solve UI issues. See bug #138020 for a possible enhancement. This tab toolbar button could allow users to easily create tabs of different profiles. The current tab implementation has UI design issues. For example (bug #383913), reattaching gnome-terminals is cumbersome when attaching a terminal from a single-tab gnome-terminal to another single-tab gnome-terminal. It requires creating an extra tab on each window, dragging the desired tab to the other window, then deleting the two recently-created dummy tabs. A tab toolbar simplifies the matter greatly: simply drag the tab to another gnome-terminal and the zero-tab window disappears. What about people who don't want to see a a toolbar? Why not give the tab toolbar an auto-hide option like a gnome-panel? This pleases people who want both constant-sized terminals and windows. An auto-hidden tab toolbar could reveal itself when tab hotkeys are pressed and when a tab is dragged over its window from another window. Bonus points for a toolbar transparency option :)
I like not having the tab bar around when not needed (it makes g-t feel like xterm), but I am almost willing to have the tab bar always on to prevent the window from frequently resizing. If auto-hide does not resize the window, then I would be game for it (it could just expand above the terminal like g-p does over windows). I do have two concerns though. Being able to hover over the auto-hide tab bar could be very difficult. g-p has the benefit of being on the edge of the screen (as in very easy to mouse over), but g-t will not have this aid in hovering over the tab bar. I can also see it causing a few problems while highlighting things in the terminal. Of a different note, I am among the many others who wonder why attachment 57588 [details] [review] still has not been committed. It seems to be a very clean patch and isn't long to review. As far as its usefulness, compare it against the menu bar. I NEVER use the menu bar. Since I never use it, I have obviously turned it off. I very frequently use the tab bar, but it still annoys me to have it constantly resizing (as a user, I am the worst case of normally having 1-2 tabs and the second tab being temporary).
It would be very nice to have the tab bar always there, even with only one tab. (as an option of couse like in firefox)
I also think it would be nice to have a "Always show tabs" preference, and it would be consistent with many other gnome programs.
The patches need to be updated to svn trunk.
*** Bug 383913 has been marked as a duplicate of this bug. ***
I cannot reproduce the window growth problem from comment 29 on svn trunk, so I'm setting the patch status to 'obsolete'.
*** Bug 514757 has been marked as a duplicate of this bug. ***
See the latest patch in bug 75420 for how a correct patch for this feature would manage the gconf setting.
Created attachment 120317 [details] [review] updated patch based on bug 75420
Attachment 120317 [details]: Minor code style issues: + if (!show_tabs) + { Needs to indent the brace 2 spaces more. +terminal_window_always_show_tabs_notify_cb (TerminalApp *app, + GParamSpec *pspec, + TerminalWindow *window) Should call update_tab_visibility instead of duplicating. + gtk_notebook_set_show_border (GTK_NOTEBOOK (priv->notebook), !single || show_tabs); And move that to update_tab_visibility too.
Created attachment 135450 [details] [review] implement gconf setting to always show tabs Please let me know if this needs more work
Looks mostly ok now, a few nits: + gtk_notebook_set_show_border (GTK_NOTEBOOK (priv->notebook), show_tabs); Can't we keep this always set to FALSE ? Due to gtk bug 123408 it will show the border anyway if there's more than 1 tab. (If you keep this, you'll need to add code that unshows the border when the window goes fullscreen, and reshows it when unfullscreening; that won't do anything right now but will once the gtk bug is fixed.) +terminal_window_always_show_tabs_notify_cb (TerminalApp *app, + GParamSpec *pspec, + TerminalWindow *window) +{ + TerminalWindowPrivate *priv = window->priv; Unused var now.
*** Bug 570026 has been marked as a duplicate of this bug. ***
*** Bug 679140 has been marked as a duplicate of this bug. ***
One use-case for keeping tabs around, even if there is only a single one is that without it, merging two windows (i.e. making one window a tab of another one) is rather awkward. I'm running gnome-terminal-3.10.2-1.fc20 on Fedora 20
Another use case: I use gnome-terminal from an `ssh -x` session. If I add a second tab to a maximized window, the gnome-terminal window expands & goes behind the task bar. I have to restore the window & maximize it again.
I added a global (dconf only) pref to always show the tab bar, in git master: $ gsettings set org.gnome.Terminal.Legacy.Settings tab-policy always The original problem in comment 0 appears to be fixed too, since in gnome-shell the window moves upwards instead of downwards when aligned to the bottom panel (classic mode). More improvements to this pref are tracked in bug 613642. *** This bug has been marked as a duplicate of bug 613642 ***