[GRASS-dev] what's going on in r39326

Maris Nartiss maris.gis at gmail.com
Wed Sep 30 11:41:24 EDT 2009

This is hottest topic of the month! Will I get extra geek points for
starting it?

2009/9/30, Hamish <hamish_b at yahoo.com>:
> thanks all for the clarifications. The bit which was missing
> for me was finding context for it due to the "why".
Yeah. Sorry. GRASS startup is a bit of code and a lot of black magick ;)
> Paul Kelly wrote:
>> If I understand correctly, the patch is attempting to solve
>> two separate issues:
>> 1) When starting GRASS by double-clicking on the grass64.sh
>> icon, the user doesn't get a terminal window in which to
>> enter GRASS commands.
> this should be handled by ticking the "run in terminal" box
> when setting up the launcher.
Doesn't apply.
> In the latest Debian package we have set 'needs="text"' in the
> menu entry:
> http://svn.debian.org/viewsvn/pkg-grass/packages/grass/trunk/debian/grass.menu
> (just added in svn65 source gui/icons/, other branches soon)
Doesn't apply.
> and "Terminal=True" in the desktop icon setup:
> http://svn.debian.org/viewsvn/pkg-grass/packages/grass/trunk/debian/grass.desktop
> (already in source in gui/icons/)
Doesn't apply.
> and to complete the offerings a "x-grass" script for starting
> grass in a terminal without needing to set it up as above.
> for now it exits with error if it can't get a terminal.
>  http://svn.debian.org/viewsvn/pkg-grass/packages/grass/trunk/debian/x-grass
> (this was debian bug#503371)
GRASS 6.5 should now work without any Debian-specific workarounds in
more universal way (non-hardcoded paths, xdg-utils from Portland
> maybe those help.
> IMO the packaging is the correct place to set this stuff up.
This patch addresses those users who for some reason are NOT using
packagers provided way of running GRASS.
Consider following scenarios that now work correctly:
Joe The Averageuser compiles GRASS on Slackware (good old times) and
creates symlink on his Desktop to /usr/bin/grasXY
Jane The Poweruser uses KDE run quicklauncher to start grassXY (thus
NOT using any .desktop files with proper terminal=required
> As mentioned by others there are valid times when you don't
> want a terminal. (the WinGrass installers don't open terminals
> unless you ask for them) [note some .sh replaced by .bat there]
Valid time users use valid approaches. If something works by accident,
it shouldn't be considered a norm.
>> 2) GRASS doesn't exit properly because the Init.sh runs in
>> the background waiting for user input that never arrives.
> the above should take care of that. At least from the GRASS
> desktop icon the last thing I see is "cleaning up temp files.."

You can't see anything without a terminal.
> veering off-topic:
> IMO it is a mistake to have shutting down the GUI try to close
> down the terminal as well. If GUI is started from the terminal
> with g.gui this is definitely not what you want.
As GRASS 6.x consists of CLI part (terminal) and GUI *on top of it*, I
agree. My commits don't change GRASS 6.x components (CLI+GUI).  If we
are dropping CLI (terminal) in GRASS 7, then startup parts and GUI
should be build there (trunk) around new paradigm but, please, do not
change 6.x version.
Still in r39350 I have added gis.m option to terminate GRASS session
besides usual exit gis.m option. It's a bit of kludge as gis.m is not
tightly coupled with other GRASS parts (Init.sh). It migh require
aditional hacking on Mac and Windows to provide equivalent
functionality there (no idea). Still it's better than nothing.
> Paul:
>> Point (1) seems to me just an issue of user preference. I
>> would be wary of anything that assumes the user is wrong, or
>> the user doesn't know what they want, which this fix seems
>> to do. Perhaps they only want the GUI and don't want a
>> terminal window to pop up?
> I agree
GRASS 6.x paradigm is CLI + GUI. It's how it is designed and most of
existing tutorials also assume presence of terminal that provides CLI.
>> Regarding point (2), why not just launch the GUI in the
>> foreground instead of the background? When it exits, control
>> will be returned to Init.sh which can then clean up and
>> exit. The check for whether there is no terminal attached
>> could be used to force GUI rather than text mode.
> fyi in 6.5 and 7 g.gui now backgrounds the gui, but the init.sh
> and AFAIK guis themselves do not. (I think gis.m used to)
If GUI doesn't release terminal after startup in GRASS 6 (on Linux),
it should be considered a bug and should be fixed. gis.m does this,
can't test wxgui, as it's still broken on Linux.
> thanks,
> Hamish

All of You have three options:
fix code/report bug/revert

Can we move on?

More information about the grass-dev mailing list