wingrass: launching gui and shell [was: Re: [GRASS-dev] Wingrass and TclTk]

Michael Barton michael.barton at asu.edu
Sat Nov 3 15:48:23 EDT 2007




On 11/3/07 12:11 PM, "Moritz Lennert" <mlennert at club.worldonline.be> wrote:

> Michael Barton wrote:
> 
>> The command prompt in GRONSOLE works to run all GRASS modules and scripts
>> EXCEPT those that require an interactive (e.g., curses) xterm interface.
>> There aren't many of these left and only some of those will run well in
>> Windows I suspect. It will also run Unix commands (many unavailable in
>> Windows anyway) that don't require an interactive response (e.g., ls, cat,
>> etc). Beyond the interactive part, I'm not sure why some people think it is
>> so limited. It is designed to be a GRASS terminal, not a general purpose,
>> everything Unix terminal.
> 
> The enourmous advantage of using the command line for grass is the
> almost unlimited capacity to mix grass commands with others or just to
> be able to combine different grass commands. The scripts in the scripts
> directory are a perfect example of such combination.

You can combine GRASS commands with any other kind of command in the
GRONSOLE command line. All it does is pass whatever you type to the shell.

> 
> I know I can use the gronsole prompt to type in grass commands, but this
> is only a very small part of the added value of the command line. I know
> I can use some other shell commands on the gronsole, but it's not easy
> to combine them into scripts and ISTR that the commands you can use are
> limited (e.g. can you run a 'for * in g.mlist' type of loop ?).

Maybe I don't quite understand. But you can write a script of any kind
recognized by the shell and run it from the GRONSOLE command line.

For example, I just wrote a small Python script called test.py

x=1+2
print x

>From the GRONSOLE command line, 'python test.py' returns 3 in the output
window.

You can't do something interactive, however. That is, you can't type
'python' and then treat the GRONSOLE as an interactive Python terminal.

> 
> AFAICT, windows commands do not work at all.

If they work from GRASS command line (i.e., whatever shell you have), they
will work from GRONSOLE. If they don't work from the GRASS command line they
probably won't work.

> 
> So, at this stage, I don't think that the gronsole prompt can replace a
> command line.

It cannot replace it for everything. AFAICT, it works fine for every command
EXECPT those that require some kind of interaction.

> 
> The question, therefore, is, whether we think that most windows users
> should have access to a command line by default, or whether this is
> confusing to most and thus should be left to those who feel comfortable
> launching grass directly from a cmd.exe window with the -text option (or
> modify their .grasssrc6 file by hand).

I guess, my thought is the same as Benjamin's. Why not make it an optional
item from the menu? Why not do this for all of GRASS? We could make it a
cmd-key combinations (cmd-t maybe) if people want so that it's easy to
launch. Or make an init.sh startup flag (e.g. -guiterm) so that people who
always want to terminal can have one automatically launch.

Michael

> 
> Moritz

__________________________________________
Michael Barton, Professor of Anthropology
Director of Graduate Studies
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton





More information about the grass-dev mailing list