This title has a duplicated question and confirmed as a bug. But it was in Ubuntu 17, mine is Ubuntu 18.04 LTS. So I guess the bug in the old question is fixed. Bug I still encounter it, so here is my problem:

File disk.desktop >>

[Desktop Entry]
Name=Disk Manager
Comment=Open df cmd in Terminal
Keywords=disk; manager; terminal;
Exec=gnome-terminal -t "Disk Manager" --hide-menubar -e "df -h --output=source,used,size,avail,target -x devtmpfs -x tmpfs -x squashfs"

The star is in the last line:
gnome-terminal -t "Disk Manager" --hide-menubar -e "df -h --output=source,used,size,avail,target -x devtmpfs -x tmpfs -x squashfs"

My command is run gnome-terminal which execute the df app with a few arguments of it. The .desktop file has a very weird behavior. It simply does nothing, not even firing error code.

If I remove all of its arguments except the -h, it works some times. If I run df app in a running terminal, it runs very well. So my money's on gnome-terminal's fault.

I decided copy my whole command to an running terminal. And the result is half-title:

# Option “-e” is deprecated and might be removed in a later version of gnome-terminal.
# Use “-- ” to terminate the options and put the command line to execute after it.

Since I got no error code. I have no idea what to do next. Please tell me how to fix it. Thanks.

Update 7-Feb-2019 ::

Follow @vidarlo advise, I've changed to option flag --. Here is the result:

  • -- doesn't work with command within the " " quote. It returns a fail execution error: Fail to execute child process "df -h"
  • I couldn't find any doc for this option. Not in man not in --help-all. It seems to me that this flag is not standard yet.

What I look for is an option allow me to pass command with a few arguments. In Lubuntu, it looks like this lxterminal -e "df -h -x devtmpfs -x tmpfs -x squashfs".


5 Answers 5


Read the error message:

# Option “-e” is deprecated and might be removed in a later version of gnome-terminal.
# Use “-- ” to terminate the options and put the command line to execute after it.

The error message tells you that -e is deprecated, and may be removed in future versions, and the alternative to -e.

You have the following command line:

Exec=gnome-terminal -t "Disk Manager" --hide-menubar -e "df -h -- output=source,used,size,avail,target -x devtmpfs -x tmpfs -x squashfs"

Change this to

Exec=gnome-terminal -t "Disk Manager" --hide-menubar -- "df -h --output=source,used,size,avail,target -x devtmpfs -x tmpfs -x squashfs"
  • 17
    The -- only work without " to me. Which means I cannot use arguments. If I do like this: gnome-terminal -- "df -h", it will open a new terminal with an error: "Fail to execute child process"... Also, I found no man for the option -- of gnome-terminal at all.
    – user910555
    Feb 7, 2019 at 14:43
  • You could always just put the df -h --ouput . . .` command in a script or alias and put the name of that there instead of the code. Oct 1, 2022 at 9:00
  • 1
    It only works if you open a single tab
    – jean-loup
    Aug 22 at 9:45

You want:

gnome-terminal -t "Disk Manager" --hide-menubar -- df -h --output=source,used,size,avail,target -x devtmpfs -x tmpfs -x squashfs

-- is generally the universal command line syntax for "nothing after this should be interpreted as an option". In this case, GNOME Terminal just takes any arguments it's given and executes them as a command line, with the first argument as the program as the rest as the program's arguments.

-- "df..." failed because it was using the entire command line as the executable name.


I've could use -- with command that contains parameters (remember remove doble quotation marks which surround the command to be passed to the terminal. Otherwise it will fail)

Exec=/usr/bin/gnome-terminal -- globalprotect connect -u $USER_VPN -p $VPN_TO_CONNECT

This worked fine for me. Execute the complete line in your terminal (avoid the Exec= part obviously) before save the file to check if it's working as you expected or not and so save time.


As discussed in other Q&A, the only straightforward, non-deprecated way to open multiple tabs is to issue the command multiple times, such as the answer at Unix & LInux to the question, Opening new gnome-terminal (v3.28+) with multiple tabs and different commands, by Владимир Савостин.

gnome-terminal -- bash -c "myCommand -some-args; bash"
gnome-terminal -- bash -c "myOtherCommand -some-args; bash"

If I want to extract a longer expression from each command, it seems I had to create a script and call that, which I did in place of using ; bash to keep the window open. I used a simple run_cmd.sh:

#! /bin/bash

set -euo pipefail

display_success() {
  read -p "Exited with success; press enter to exit..."

display_error() {
  read -p "Exited with error value $1; press enter to exit..."

run_cmd() {
  echo "Running: $@"
  "$@" && display_success || display_error $?

run_cmd "$@"

I then replaced bash -c with run_cmd.sh. Since that script is trivial, please consider it as in the public domain.


this worked for me...to start an editor like vim

exec_command = f"gnome-terminal -e 'bash -c "{editor_name} " + path_file + "; exec bash"'"

command_var = f"bash -c "{editor_name} " + path_file + "; exec bash""
exec_command = f"gnome-terminal -- {command_var}"

You must log in to answer this question.