Closed IntegratedQuantum closed 3 months ago
As @garrett96 mentioned, you can test for a terminal with test -t 0
. If true, then we're good. But otherwise, we have several rather ugly options.
Unfortunately, the name of the terminal app is not standardized, and there may be more than one. Here's a list of common terminal applications compiled from this SO post.
For X11 -> xterm
For Kde -> konsole
For GNOME -> gnome-terminal
For xfce4 -> xfce4-terminal
For Cinnamon -> x-terminal-emulator
For MATE -> mate-terminal --window
For Unity -> gnome-terminal --profile=Default
For Pantheon -> pantheon-terminal -w ''
But we don't really know which one the user wants to open. It's possible to guess by using the most specific one, or the one they are running right now, or by trying to match $TERM
or something like that. All this feature sniffing would take time and complexity and add even more confusion when it doesn't work. It also reminds me of browser sniffing on the web, so I'll leave that for someone else.
Alternatively we can just pipe everything to screen
or a log file, and let the user know where to find the logs. But at that point we might as well ask that they open Cubyz in a terminal in the first place.
Alright, since there seems to be no simple, short-term solution I'm closing this in favor of #227, which would be the go to solution for all people who don't want to use the terminal. With #227 the logs should be displayed in the launcher.
Opening a bash file from the file explorer does not open a terminal by default. Like in #381 this can lead to some confusion when a compiler error happens.