Fixes a bug with gnome-terminal.
Fixes #367.