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 Icon=harddisk Type=Application Categories=Utility;Management; Keywords=disk; manager; terminal; StartupNotify=true 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
--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".