Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I implemented the answer to this question and now the title bar is gone from the terminal. I found that the python script had to execute twice to have the effect applied. Rather than tapping out ./ twice every time I started a new terminal, I created maximize to execute the script twice. This script is hotkeyed to Ctrl-Alt-Y.

Currently I've used

gnome-terminal --maximize -e /home/jason/maximize

gnome-terminal --maximize -x /home/jason/maximize

as arguments for Ctrl-Alt-T.

The issue is I can see the outline of a new terminal flash on screen, but it doesn't exist for more than a fraction of a second. How can I make the new window more persistent?

share|improve this question
up vote 2 down vote accepted

The -x option to gnome-terminal or, similarly, the -e option to other xterm-compatible terminal applications, tell the terminal emulator to start the command following the -x/-e option and then exit. This is the reason why you're seeing the terminal outline flash and disappear: the terminal starts, maximizes, then exits.

You could instead include the maximize command into your .bashrc or .profile, so that it is executed every time a shell is started.

However, since it executed each time a shell is started, you need to find a way to execute it only when the shell is started from the terminal application. On my Ubuntu 11.04 system the following does the trick:

if [ -n "$DISPLAY" ] && [ "$SHLVL" = 1 ]; then
  # the following commands are only executed when
  # the shell runs inside a terminal

The -n "$DISPLAY" part tests if there is a graphical X11 display active, and the $SHLVL part checks if this shell is 1st level shell, i.e., a direct child of the terminal application (a shell may start another shell for running commands or script, but in this case the $SHLVL value will be larger than 1).

share|improve this answer
Thanks for the help, works like a charm! – Jason Nov 5 '11 at 23:36

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.