2020-04-29

What is the best Linux terminal emulator?

(Or: Why doesn't Lubuntu PCManFM-Qt's "Execute in Terminal" work?"

Gnome-terminal is the best.

Admittedly, the only other ones I've tried are Sakura, QTerminal, and XTerm.

But hear me out.

Gnome-terminal is the only one that handles executing command arguments with spaces properly, like XTerm does.

I only say Gnome-terminal is better than XTerm because XTerm is a little too old school for me.


The problem with QTerminal

If you run:

qterminal -e sh "/path/to/Folder Name With Spaces/do stuff.sh"

QTerminal will screw up on the first space, splitting the string into multiple arguments.

This is a known problem from 2017, so I'm not holding my breath for it to be fixed.  I don't know why, but QTerminal has other white space problems too.


The problem with Sakura

Sakura has the exact same problem.  If you run:

sakura -e sh "/path/to/Folder Name With Spaces/do stuff.sh"

Sakura will screw up, splitting the string into multiple arguments due to the spaces.

Sakura is better than QTerminal in that it will work if you escape the double-quotes:

sakura -e sh \"/path/to/Folder Name With Spaces/do stuff.sh\"

Unfortunately, file managers like PCManFM-Qt does not escape the quotes when it opens a script for you in your terminal.


XTerm and Gnome-terminal does it right

Well, the -e option still doesn't work for Gnome-terminal but I guess it does for XTerm.  However, Gnome-terminal has the -- option which does work properly!

This works!

gnome-terminal -- sh "/path/to/Folder Name With Spaces/do stuff.sh"

And file managers like PCManFM-Qt does work with it to properly open a script in gnome-terminal, even if the path to the script contains spaces.

Now go check out how to change the default terminal in Lubuntu.

No comments: