14

I recently installed Lubuntu 16.04 with gnome-terminal. I like gnome-terminal to consume less space on monitor. But latest version comes with two annoying buttons at the right top corner which makes no sense to me. Because, user who prefer terminals are more likely to use keyboard shortcuts to do tabs operations rather than go for mouse clicks. With these two extra buttons tabs bar got wider and uses more space on the monitor. Click here for Screenshot . Please help me in removing this extra two buttons from the gnome-terminal window.

Thanks in Advance

Madhusudhan

5 Answers5

17

As I am running gnome shell 3.22.2 (same as izy) which ships with gnome-terminal 3.22.1 (under Arch), the solution posted by Lari Hotari doesn't work for me. It turns out that the CSS class name has changed in bug report #765590. The name is now terminal-window instead of TerminalWindow. This has been shipping with gnome since 3.20.2-ish.

The following snippet for ~/.config/gtk-3.0/gtk.css reduces the vertical size of gnome-terminal by 10px for me. Note that I tried hiding the two buttons by setting display: none but this has no effect. Maybe gtk-3.0 does not allow hiding ui elements (no idea).

/* Decrease the tabs bar height in gnome-terminal
 * See:
 * https://stackoverflow.com/questions/36869701/decrease-the-tabs-bar-height-in-gnome-terminal
 */

terminal-window notebook > header.top button {
  padding: 0 0 0 0;
  background-image: none;
  border: 0;
  margin-right: 10px;
}
terminal-window notebook > header.top > tabs > tab {
  margin: 0 0 0 0;
  padding: 0 0 0 0;
}
terminal-window notebook > header.top > tabs > tab label {
  padding: 0 0 0 0;
  margin: 0 0 0 0;
}

Make sure to logout/login out of gnome-session after changing the css file.

Before: Screenshot before modification

After: Screenshot after modification

Update: actually removing the two buttons from the tabs menu bar in the top right corner (as requested by the OP) requires you to re-compile gnome-terminal (it isn't that difficult with apt source under ubuntu). Just remove the terminal_window_fill_notebook_action_box call on line 2792 in src/terminal-window.c: https://github.com/GNOME/gnome-terminal/blob/8975986d51639040ceb6ba1c0dc78f6a3fa9da45/src/terminal-window.c#L2792

sidcha
  • 341
  • 2
  • 15
fvdnabee
  • 513
  • 5
  • 11
4

Adding this to ~/.config/gtk-3.0/gtk.css works for me. It doesn't remove the buttons, but makes them nicer for a dark theme and use less vertical space.

TerminalWindow .notebook .button,
TerminalWindow .notebook .button:active {
    padding: 2 2 2 10;
    background-image: none;
    border: 0;
}

I'm using this customization, works well with a dark theme:

@define-color bg-grey #222;
@define-color active-grey #333;
@define-color border-grey #555;

TerminalWindow .notebook {
  border: 0;
  padding: 0;
  color: #eee;
  background-color: shade(@active-grey, 1);
}

TerminalWindow .notebook tab:active {
  border: 1px solid @border-grey;
  background-color: shade(@active-grey, 1);
}

TerminalWindow .notebook tab {
  background-color: shade(@bg-grey, 1);
}

TerminalWindow .notebook .button,
TerminalWindow .notebook .button:active {
    padding: 2 2 2 10;
    background-image: none;
    border: 0;
}
Lari Hotari
  • 4,500
  • 28
  • 35
1

xfce4 xubuntu 17.10

tee --append ~/.config/gtk-3.0/gtk.css <<SMALLERTABS

notebook tab {
  min-height: 0;
  padding-top: 0px;
  padding-bottom: 0px;
}

notebook tab button {
  min-height: 0;
  min-width: 0;
  padding: 0px;
  margin-top: 0px;
  margin-bottom: 0px;
}

notebook button {
  min-height: 0;
  min-width: 0;
  padding: 0px;
}
SMALLERTABS

close terminal and reopen

reference:

jmunsch
  • 16,405
  • 6
  • 74
  • 87
0

Gnome 3.28.3 on Ubuntu 18.04

The following code removes the button for me. Here is the effect

notebook.terminal-notebook > header > box button,
notebook.terminal-notebook > header > box button:hover,
notebook.terminal-notebook > header > box button:hover:backdrop {
    margin-top: -100px;        /*this is the line that makes buttons disappear.*/
    background: inherit;
    border: inherit;
    padding: inherit;
}

Adwin1033
  • 3
  • 3
  • Welcome to stackoverflow. Please edit your answer to make it clear what your answer provides that the other established answers do not. – Simon.S.A. Jun 10 '19 at 04:13
  • 1
    @Simon.S.A. I provide the correct selector names in gnome 3.28.3 and method of removing the buttons which the highest voted answer lack. – Adwin1033 Jun 10 '19 at 06:40
  • You could provide the full file path into which we can paste your code. – Stephane Nov 20 '20 at 11:21
0

you can remove them easy in dconf editor.. /io/elementary/terminal/settings/

tab-bar-behavior..... select "hide when single tab" or never show tabs...