-
-
Notifications
You must be signed in to change notification settings - Fork 350
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
init: Do not ask for a terminal in the freedesktop entry #1221
base: main
Are you sure you want to change the base?
Conversation
This specifies that the GRASS GIS desktop application should not start with a terminal in the Freedesktop Desktop Entry file.
so, the intention is to start the GUI without a console (e.g. windows console in winGRASS)? How should a user proceed if he needs a console for data processing e.g. with GDAL? starting an extra console? |
that's a very linux centered view of world. the windows part of the world doesn't work in that waya as there is no terminal to launch programs as in linux.... dll hell is greeting you ;-) |
I've been experimenting with starting without terminal using grass-conda package repo with success (I have not yet pushed any changes there, but the concept is feasible).
This is a crucial question for this kind of distribution (GRASS.app) for Mac. A possible and workable solution would be adding a setting to |
I don't know what in (the current) GRASS GIS (code) should be driven by this settings. GRASS GIS does not decide about the terminal in which it runs (e.g. Gnome Terminal). It only decides about starting or not starting a shell (e.g. Bash). The presence of terminal is detemined by the system (i.e., installation) or the user (by system configuration or on-the-fly). This is exactly why 171db2e (#768) is need. GRASS GIS can be started without a terminal and in that case, no shell can be started, so 171db2e starts with shell "only if possible," i.e., only when there is a terminal. On the other hand, the point of this PR is to install/configure GRASS GIS in the system in such as way that clicking a "start GRASS GIS" menu item or icon does not open a terminal window, but only the GUI. Importantly, it does not influence how GRASS GIS behaves when started from a interactive terminal. |
Right, that black thing on Windows should go away.
What do you think is appropriate for a typical Windows user? For example, the Console in GUI provides access to the command line tools. |
How this should behave on Windows is whatever matches the basic idea behind this PR: If GRASS GIS is started in the standard way, only the GUI opens, not the terminal. Advanced users who wish to use an actual command line shell and not just Console in GUI should be able to do whatever is common on their platform, e.g., starting a terminal application and executing GRASS GIS (as a command or path to an executable) and getting a (sub-)shell in GRASS GIS session. |
For a GRASS.app that code would be in: For a working example, see draft at:
Forgive me for perhaps explaining obvious things. An app-bundle for macOS (e.g. GRASS.app) is in fact a directory typically represented in GUI with an icon (the ".app" part of the name it is hidden). It is double-clickable to start the app. This app-bundle contains everything needed, in the case of the miniconda based build of https://github.com/nilason/grass-conda/, all dependencies and GRASS code is located within (amounting to at present a massive 1.8 GB!):
For the typical Mac user, app-bundles are the expected way to start applications and to be distributed. They are, by design, completely self contained and are not included in e.g. shell env |
That makes sense to me and it seems to me as a corresponding solution for this PR for macOS.
For Linux this would be an interesting feature, but it is not needed. The workflow and path expectations are different and if you really desire terminal after clicking the "icon," it is quite easy to change it. It would be also difficult to implement. I'm not sure what you mean by @hellik is |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what you mean by startWithoutShellIfPossible. What do you mean by shell and when staring without is is not possible? That's perhaps discussion for #1227.
With "shell" I mean a Terminal shell. An installation with e.g. MacPorts, will give/gives the opportunity to start by "clicking the icon" as well as through terminal (as grass7x binary is in the PATH in that case). In the latter case it doesn't make any sense to not start with terminal shell. But let's continue this discussion in #1227.
Back to what prevented this from being merged: The following GIS Geography review strongly suggests that "the black thing" which starts with GRASS GIS is unexpected behavior on Windows. GIS Geography: GRASS GIS – Geographic Resources Analysis Support System:
|
Does this still make sense now? It's a single line change, is someone with a Linux desktop test it again (4 years later) |
There is nothing to test. There simply is no consensus how it should work. We should keep in mind that on Debian is possible to install GRASS without GUI and the desktop file still gets installed (=GRASS shows up in KDE app launcher). Thus Debian packagers would have to patch the desktop file anyway to avoid confusing "nothing happened when I clicked on GRASS icon". |
It seems strange to me that a desktop file would be installed for a CLI only application, although perhaps Octave behaved this way at least in the past. At this point, I get nothing for Python in the desktop app search on (Debian/Ubuntu based) Pop!_OS and for Octave, I get the desktop app. After starting a terminal window, I can run Installing a desktop file for the GUI package seems to me like the way to go, i.e., distributions should not install desktop file for the CLI package of GRASS GIS, only for the GUI one. |
So, does this PR do this? Should it be closed? |
@sebastic any comments on this? |
The Debian package just ships the grass.desktop installed by the grass build. It's up to the GRASS developers whether they want to provide separate desktop integrations for the GUI and CLI, switch the existing desktop file from CLI to GUI, or leave things as they are. If the desktop file is changed to launch the GUI, the file will simply move from the grass-core to the grass-gui package. |
Thank you for explanation. I would vote for discarding this PR and creating two desktop files instead – one with |
Why not just do it in here? It seems small and relates to the discussion that happened here. |
This PR specifies that the GRASS GIS desktop application should not start with a terminal in the Freedesktop Desktop Entry (
.desktop
file).Based on the discussion in Make terminal window optional? (grass-dev, Sep 5-12, 2020) we are going with (option 2):
Remove the terminal from desktop launchers so that GRASS GIS starts without the terminal when started in the GUI way. When a user starts GRASS GIS using a command from an existing terminal, there is no change from the current behavior: a (sub-)shell is started and possibly GUI launches.
In other words, the terminal experience with an interactive shell is now opt-in with this PR.
The correct behavior (i.e., not a failure) without an interactive terminal is enabled by 171db2e (#768). The GUI will provide a clear application main window title after #1216 and a smooth quit experience after #1219.
This PR only changes the
.desktop
file provided with GRASS GIS. It does not change any actual installers or packages, especially no change is done for Windows and macOS.Package/installer maintainers, please take an action for your platform. Open separate PRs if applicable.