I recall that some time ago, when I issued "g.list rast" I would get
the list of rasters and the command prompt right after it. Now, when I
run the command I get the raster list and no command prompt. I have to
hit q to get back to the prompt and the raster list is gone, just like
when reading a man page. I tried to change GRASS_PAGER env to more,
cat but nothing happened. What am I doing wrong? I'm using Debian
testing with grass 6.2.1
I ran into this when going from tcsh (OSX 10.2) to bash (OSX 10.3). I added
export LESS=-X
to my .bash_profile so the contents would remain visible after the command completes. And in OSX at least, more is symlinked to less. Maybe it's similar on Debian?
On Jul 23, 2007, at 8:42 AM, Daniel Victoria wrote:
Hi all,
I recall that some time ago, when I issued "g.list rast" I would get
the list of rasters and the command prompt right after it. Now, when I
run the command I get the raster list and no command prompt. I have to
hit q to get back to the prompt and the raster list is gone, just like
when reading a man page. I tried to change GRASS_PAGER env to more,
cat but nothing happened. What am I doing wrong? I'm using Debian
testing with grass 6.2.1
There is a theory which states that if ever anyone discovers exactly what the universe is for and why it is here, it will instantly disappear and be replaced by something even more bizarrely inexplicable. There is another theory which states that this has already happened.
-Hitchhiker's Guide to the Galaxy 2nd season intro
I recall that some time ago, when I issued "g.list rast" I would get
the list of rasters and the command prompt right after it. Now, when I
run the command I get the raster list and no command prompt. I have to
hit q to get back to the prompt and the raster list is gone, just like
when reading a man page. I tried to change GRASS_PAGER env to more,
cat but nothing happened. What am I doing wrong? I'm using Debian
Yes, setting GRASS_PAGER to cat should give you the behaviour you describe, I think. Are you sure it was set properly? Most GRASS modules that use the GRASS_PAGER environment variable call it with system() or similar and pass it the name of a temporary file, whereas g.list (actually G_list() in lib/gis/list.c) starts it using G_popen() and passes the list to it on stdin, but I can't see how that should make any difference.
I tried to change GRASS_PAGER env to more, cat but nothing happened.
What am I doing wrong?
Not setting GRASS_PAGER correctly, probably.
Typing e.g.:
export GRASS_PAGER=cat
in the shell should affect all subsequent commands run from that
shell. If you have gis.m running, you'll need to restart it in order
to affect commands which are run from it. If you want to make it
permanent, put it in ~/.bashrc.
I was trying to set the GRASS_PAGER variable using g.gisenv set=
command and it was not working. I did it with the export command and
it now works. Funny thing is that the pager is set correctly at the
.grassrc6 file but grass ignores it. Will have to put it on bashrc
Thanks
Daniel
On 7/23/07, Glynn Clements <glynn@gclements.plus.com> wrote:
Daniel Victoria wrote:
> I tried to change GRASS_PAGER env to more, cat but nothing happened.
> What am I doing wrong?
Not setting GRASS_PAGER correctly, probably.
Typing e.g.:
export GRASS_PAGER=cat
in the shell should affect all subsequent commands run from that
shell. If you have gis.m running, you'll need to restart it in order
to affect commands which are run from it. If you want to make it
permanent, put it in ~/.bashrc.
> I recall that some time ago, when I issued "g.list rast" I would get
> the list of rasters and the command prompt right after it. Now, when
> I run the command I get the raster list and no command prompt. I
> have to hit q to get back to the prompt and the raster list is gone,
> just like when reading a man page. I tried to change GRASS_PAGER env
> to more, cat but nothing happened. What am I doing wrong? I'm using
> Debian
Paul Kelly wrote:
Yes, setting GRASS_PAGER to cat should give you the behaviour you
describe, I think. Are you sure it was set properly?
Debian packaging rules state that the default pager will be 'less', not
GRASS's default of 'more'. My personal preference is if not using 'more'
then use 'cat' or rip out the pager code all together. With 'more' if
you keep bashing expected keys you get back to the prompt. Also you can
scroll back in the terminal window without any clear-screens clobbering
the buffer. With 'less' you have to know to press the 'q' to get out,
which new non-unix users won't know. Also with 'less' there is the
disappearing text problem Daniel sees. Especially for g.list the output
is often less than a page-worth, so disappearing text isn't really
needed (and you can't cut and paste from it once it's gone).
William suggests:
export LESS=-X
Ah, yes that works to keep the text from vanishing.
Daniel:
Funny thing is that the pager is set correctly at the .grassrc6 file
but grass ignores it. Will have to put it on bashrc
.grassrc6 is not what you expect. It holds the g.gisenv GIS variables,
it's not a shell script containing commands like .bashrc is.
Use .grass.bashrc for setting shell enviro variables instead. (or .bashrc)
If the Debian package is to continue to use 'less', I suggest putting
a note about this in the README.Debian file.