[GRASS5] New help button - please text review

Markus Neteler neteler at itc.it
Mon Jan 31 06:10:45 EST 2005


Hamish,

On Mon, Jan 24, 2005 at 08:14:39PM +1300, Hamish wrote:
...
> idea: use xmessage  (should be installed on all Mac+Cygwin with X?)
> 
> 
> if GUI:
> 
>   if $TERM is csh like
>     setenv GRASS_PAGER "xmessage -center -file -"
> 
>   if $TERM is bash like
>     export GRASS_PAGER="xmessage -center -file -"

I tried this idea, works well for g.list etc.

However, it doesn't with g.setproj:

GRASS 6.0.cvs:~ > g.setproj

WARNING!  A projection file already exists for this location
(Filename '/ssi0/ssi/neteler/grassdata/srilanka/PERMANENT/PROJ_INFO')
...
Please specify projection name
Enter 'list' for the list of available projections
Hit RETURN to cancel request
>list
usage: xmessage [-options] [message ...]

where options include:
    -file filename              file to read message from, "-" for stdin
    -buttons string             comma-separated list of label:exitcode


The code in lib/gis/get_projname.c is

          do {
              fprintf(stderr,_("\n\nPlease specify projection name\n"));
              fprintf(stderr,_("Enter 'list' for the list of available projections\n"));
              fprintf (stderr, _("Hit RETURN to cancel request\n"));
              fprintf(stderr,">");
          } while(!G_gets(answer));

          G_strip(answer);
          if(strlen(answer)==0) return -1;
          if (strcmp(answer,"list") == 0) {
            if (isatty(1)) {
              sprintf(buff,"$GRASS_PAGER %s",Tmp_file);
            }
            else
              sprintf(buff,"cat %s",Tmp_file);
            system(buff);
          }

Is it the isatty?

Markus




More information about the grass-dev mailing list