57

I want to tell compiz, metacity, the gnome-terminal or whoever is in charge to open the terminal window maximized by default.

How can I do that?

EDIT for the future: most of the answers were upvoted in older ubuntu versions, since 17.10 and on the most upvoted solutions do not work.

tutuca
  • 2,682

11 Answers11

54

Launch gnome-terminal as such:

gnome-terminal --window --maximize
Tommy Brunn
  • 9,751
  • It works with the shortcut in the menu bar but it doesn't if I lunch it via gnome-do :(

    I'm accepting this answer anyway :)

    – tutuca Aug 05 '10 at 17:27
  • I'm pretty sure Gnome-do depends on what's set in the gnome-terminal.desktop file. – Firefeather Oct 29 '10 at 20:13
  • this works when you launch the command from the terminal or something of the like, but it has no effect on the .desktop file on ubuntu 17.10+ – tutuca Mar 16 '18 at 22:09
39
  • Open a Terminal.
  • From Edit menu select Profile Preferences.
  • Tick Use custom default terminal size and enter a default size that is too large for the screen e.g. 240 columns and 100 rows.

Close, then open a new Terminal by clicking the icon (or press Ctrl + Alt + T): the new terminal window should be maximised.

This answer is based upon advice I was given here: How to make terminal start maximized?

Craig
  • 1,306
  • 2
    I confirm this works in 12.04, and is probably the easiest solution (at least for people like me who always work with maximized windows) - thanks! My advice is to set the default columns and rows to just slightly more than what fills the screen, in order not to have problems in case you un-maximize the window. – Walter Tross Dec 29 '12 at 14:57
  • 1
    If you temporarily need a small window, you can always un-maximize the window (double click on top) and click on Terminal > 80x24 – Walter Tross Dec 31 '12 at 08:59
  • 1
    This is the simplest way that works! – xmllmx Aug 12 '15 at 04:58
  • That's what I'm doing, but it makes it only almost maximized with a narrow margin on the right and the bottom. Even if I enter absurd 999 x 999 dimensions. – Paul Jurczak Sep 16 '21 at 10:37
31

If you want gnome-terminal to open fullscreen when you open it with Gnome Do or the Applications menu, put the following into a file named gnome-terminal.desktop and put that in ~/.local/share/applications.

[Desktop Entry]
Name=Terminal
Comment=Use the command line
TryExec=gnome-terminal
Exec=gnome-terminal --window --maximize
Icon=utilities-terminal
Type=Application
X-GNOME-DocPath=gnome-terminal/index.html
X-GNOME-Bugzilla-Bugzilla=GNOME
X-GNOME-Bugzilla-Product=gnome-terminal
X-GNOME-Bugzilla-Component=BugBuddyBugs
X-GNOME-Bugzilla-Version=2.32.0
Categories=GNOME;GTK;Utility;TerminalEmulator;
StartupNotify=true
OnlyShowIn=GNOME;
X-Ubuntu-Gettext-Domain=gnome-terminal

Then log out and log back to apply the changes.

Mmmh mmh
  • 121
Isaiah
  • 59,344
  • 2
    It doesn't work in Ubuntu 12.04 – Marco Lackovic May 18 '12 at 10:40
  • 7
    Actually I found it that [Terminal] disappear from my unity dash. What I realize instead copy above code (outdated on my U13.10) it's better to copy original file $ cp /usr/share/applications/gnome-terminal.desktop ~/.local/share/applications/ and then edit it changing Exec=gnome-terminal to Exec=gnome-terminal --window --maximize.

    Logout then login again.

    – sobi3ch Jan 15 '14 at 01:57
  • Just wanted to add that I saw the change take effect after closing all my Terminal windows and then relaunching it. Not sure if that's what you meant by "log out and log back" but it worked for me. Thanks! – Alex Shroyer Feb 06 '15 at 17:03
  • Any idea to make it work with the Launcher and nautilus-open-terminal package? – leaf Apr 12 '15 at 19:46
  • gnome-terminal --help-window-options – Ciro Santilli OurBigBook.com May 04 '16 at 12:40
  • As of ubuntu 17.10 it's not working. – tutuca Nov 15 '17 at 02:47
  • 1
    Please consider updating this answer to advise copying the existing desktop file rather than creating a new one. I can't upvote this as it stands. – Resigned June 2023 Jul 08 '18 at 22:44
9

Ubuntu 12.04 and 14.04 LTS

Run ccsm (CompizConfig Settings Manager). Under Window Management enable Window Rules and open it, and in the Maximized field put class=Gnome-terminal. You may need to log out and log back in before the changes come into effect.

If you don't see Window Rules, then make sure you've got the compiz-plugins package installed.

You can do more. I use (class=Gnome-terminal) | (class=Evince).

  • I needed to reboot after adding this rule for it to take effect. – dave4420 Dec 08 '12 at 22:54
  • doesn't work for me :-(. tried rebooting, logging in and out, grabbing the window class automatically (by clicking on the Terminal). I typically start my terminal from the sidebar or with Ctrl+Alt+T. In both cases it still starts with small size. – Sergiy Belozorov Nov 22 '13 at 09:51
8

In Ubuntu 11.10 and up:

  • Search > Keyboard > Shortcuts > Custom Shortcuts > Add (+ button) >
    • Name: Launch Terminal Maximized
    • Command: gnome-terminal --window --maximize
  • Click Apply
  • Click on 'Disabled'
  • Shift+Ctrl+Alt+T
RolandiXor
  • 51,541
7

The selected answer didn't work for me on fully updated Ubuntu 12.04 LTS, so I decided it was time for a more drastic approach. The solutions below are tested up to 16.04 LTS.

My old solution

  1. Rename original gnome-terminal executable to gnome-terminal-original:

    cd /usr/bin
    sudo mv gnome-terminal gnome-terminal-original
    
  2. Create a new file in /usr/bin named gnome-terminal with the following content:

    #!/bin/bash
    /usr/bin/gnome-terminal-original --maximize $@
    
  3. Make it executable:

    sudo chmod +x gnome-terminal
    

Now no matter how I open the terminal, it always opens maximized. The only downside I see for this approach is that you have to repeat these steps every time you might update gnome-terminal with a new version via update manager or apt-get upgrade.

Note: the $@ parameter means that all arguments that might get passed to gnome-terminal will still get passed to gnome-terminal-original, along with --maximize argument.

A better solution

  1. Install "wmctrl":

    sudo apt-get install wmctrl
    
  2. Add this line to the very end of your ~/.bashrc file:

    wmctrl -i -r $WINDOWID -b add,maximized_vert,maximized_horz
    
  3. Repeat the second step for other user's .bashrc files if needed, for example, for "root" user (/root/.bashrc).

This solution will not affect the size of the terminal window initially, but rather maximize it shortly after it opens, usually in a matter of milliseconds. You can try moving the line you added in the second step to the beginning of .bashrc file, to make the terminal maximize even earlier.

Brane
  • 416
  • 3
  • 9
  • This is first thing I would always do whenever I install/re-install Ubuntu. Works like a charm. – moosambi2020 Aug 26 '16 at 02:50
  • Why doesn't this approach work for Open in terminal context menu entry in Nautilus file manager? – orschiro Oct 13 '16 at 12:55
  • @RobertOrzanna if this solution works for you in other situations, it's most likely that Nautilus runs a different terminal program (usually there's more than one installed). Try opening a new terminal while the one launched by Nautilus is running and do ps aux or ps aux | grep term to find out which executables are running. Or, try switching the arguments on the second line in the script like so: $@ --maximize. – Brane Oct 15 '16 at 15:51
  • Thanks @Brane! Please see this gif animation. – orschiro Oct 16 '16 at 07:20
  • @RobertOrzanna Wow, thanks for your effort in describing the problem. I never paid much attention to gnome-terminal, but as it turns out, the original /usr/bin/gnome-terminal itself is a launcher for /usr/lib/gnome-terminal/gnome-terminal-server. So, other programs can start gnome-terminal-server directly, in which case my first solution won't work. But, don't worry, I found another stupid trick that will work even in those cases (see my updated answer above) :) – Brane Oct 16 '16 at 13:48
  • Thanks, @Brane! Your updated answer does work excellently! This only affects gnome-terminal windows or all windows in general? – orschiro Oct 17 '16 at 05:14
  • 1
    @RobertOrzanna You're welcome, I'm glad it works for you. The updated solution should affect all terminal windows, not just gnome-terminal - try opening uxterm for example. To put it more accurately, it should affect all applications that start bash or dash in a regular window and load your .bashrc file. It's possible however, to limit the affected applications. If anyone needs that, let me know and I'll add that to my answer. – Brane Oct 17 '16 at 09:07
  • @Brane how would I auto-maximise all windows? – orschiro Oct 18 '16 at 19:44
  • 1
    @RobertOrzanna Take a look at this answer: http://askubuntu.com/questions/27826/how-to-configure-my-system-so-that-all-windows-start-maximized - basically install "maximus" and make it run at startup. – Brane Oct 19 '16 at 08:39
  • I like your old solution the best; simple and effective. Thanks! – UserX Apr 30 '20 at 16:43
6
gnome-terminal --full-screen

You could create a shortcut on your desktop or panel to this command.

popey
  • 23,667
2

If you just want the terminal to open full size on screen, use the GUI method of changing the default size through current profile preferences dialog appropriately. To do so, simply follow these steps:

  • Open a terminal
  • Choose Edit
  • In the General tab, check "Use custom default terminal size"
  • You need to adjust these values so that they fit your screen by simple trial and error

The column setting is 128 for me. You should set the values that best suit you.

wjandrea
  • 14,236
  • 4
  • 48
  • 98
Siamore
  • 824
  • 1
    Making the window the same size as the desktop doesn't make it maximized – Isaiah Oct 29 '10 at 20:20
  • 1
    @DoR I know but i still consider it as an option and a rather good and easy one at that because it will work even if he uses gnome-do and this is for a newbie who may have the same question he might find this thread and he deserves to have all options shown as he cannot ask a duplicate question and suppose he dosen't want it fully maximized or wants to use gnome-do or any new launcher this option survives... – Siamore Oct 31 '10 at 09:38
1

Just add a custom shortcut.

Go to Settings > Devices > Keyboard, scroll down to the end of the list and click on the + to add your shortcut.

Give it a name and in the command section type gnome-terminal --maximize and add your preferred keyboard shortcut combination.

damadam
  • 2,833
0

In QTerminal, you can maximize the window and then close the terminal by the "exit" command. When you Ctrl+Alt+T again it will automatically open maximized.

This can be applied to any size, just set the size you want, "exit" and then open again.

slava
  • 3,887
-1

You can probably modify your shortcuts to use the maximize one so that it always starts that way.

The easiest way of doing so is to locate your application (in /usr/share/applications or ~/.local/share/applications) and to modify your .desktop file.

In that .desktop file, you will see the line that starts with Exec=.... To start gnome-terminal maximized, all you need to do is to add --start-maximized to the end of the command.

wjandrea
  • 14,236
  • 4
  • 48
  • 98
Nigel
  • 487