[GRASS-dev] [GRASS GIS] #3966: Batch job examples: add GRASS_PAGER=cat to avoid getting stuck expecting a terminal

#3966: Batch job examples: add GRASS_PAGER=cat to avoid getting stuck expecting a
terminal
-------------------------+-------------------------
Reporter: jidanni | Owner: grass-dev@…
     Type: enhancement | Status: new
Priority: trivial | Milestone:
Component: Docs | Version: unspecified
Keywords: | CPU: Unspecified
Platform: Unspecified |
-------------------------+-------------------------
On https://grass.osgeo.org/grass79/manuals/grass7.html be sure to add an
  GRASS_PAGER=cat grass --exec g.list type=all
example, else some batch job will be ruined due to /usr/bin/pager's
{{{
WARNING: terminal is not fully functional
- (press RETURN)
}}}

As some commands, e.g., g.list, are thus booby-trapped, while others,
e.g., v.info map=abc, will not trigger the "bug".

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3966&gt;
GRASS GIS <https://grass.osgeo.org>

#3966: Batch job examples: add GRASS_PAGER=cat to avoid getting stuck expecting a
terminal
--------------------------+-------------------------
  Reporter: jidanni | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: trivial | Milestone:
Component: Docs | Version: unspecified
Resolution: | Keywords:
       CPU: Unspecified | Platform: Unspecified
--------------------------+-------------------------

Comment (by jidanni):

{{{
< else some batch job will be ruined
> else some batch jobs will be ruined
}}}

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3966#comment:1&gt;
GRASS GIS <https://grass.osgeo.org>

#3966: Batch job examples: add GRASS_PAGER=cat to avoid getting stuck expecting a
terminal
--------------------------+-------------------------
  Reporter: jidanni | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: trivial | Milestone:
Component: Docs | Version: unspecified
Resolution: | Keywords:
       CPU: Unspecified | Platform: Unspecified
--------------------------+-------------------------

Comment (by wenzeslaus):

Any idea how to reproduce this with interactive job for testing purposes?

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3966#comment:2&gt;
GRASS GIS <https://grass.osgeo.org>

#3966: Batch job examples: add GRASS_PAGER=cat to avoid getting stuck expecting a
terminal
--------------------------+---------------------------------
  Reporter: jidanni | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: trivial | Milestone:
Component: Docs | Version: unspecified
Resolution: | Keywords: exec batch grass.py
       CPU: Unspecified | Platform: Unspecified
--------------------------+---------------------------------
Changes (by wenzeslaus):

* keywords: => exec batch grass.py

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3966#comment:3&gt;
GRASS GIS <https://grass.osgeo.org>

#3966: Batch job examples: add GRASS_PAGER=cat to avoid getting stuck expecting a
terminal
--------------------------+---------------------------------
  Reporter: jidanni | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: trivial | Milestone:
Component: Docs | Version: unspecified
Resolution: | Keywords: exec batch grass.py
       CPU: Unspecified | Platform: Unspecified
--------------------------+---------------------------------

Comment (by jidanni):

Gee I only use GRASS from makefiles... not the GUI, so do not know.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3966#comment:4&gt;
GRASS GIS <https://grass.osgeo.org>

#3966: Batch job examples: add GRASS_PAGER=cat to avoid getting stuck expecting a
terminal
--------------------------+---------------------------------
  Reporter: jidanni | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: trivial | Milestone: 7.8.3
Component: Docs | Version: unspecified
Resolution: | Keywords: exec batch grass.py
       CPU: Unspecified | Platform: Unspecified
--------------------------+---------------------------------
Comment (by wenzeslaus):

I would even say a change in the source code is more appropriate if we
understand the issue more, but I'm not able to reproduce this.

The following ones behave as expected:

{{{
grass --tmp-location XY --exec g.list type=all
nohup grass --tmp-location XY --exec g.list type=all
true | (setsid grass --tmp-location XY --exec g.list type=all) 2>&1 | cat
echo "grass --tmp-location XY --exec g.list type=all" > /tmp/test.sh
nohup bash /tmp/test.sh
}}}

Only `bash /tmp/test.sh` will jump into an interactive pager which may be
little unexpected, but I'm in an interactive terminal, so perhaps
inconvenient, but not unexpected.

I'm closing this and we can discuss this in a new issue on GitHub if
needed.
--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3966#comment:6&gt;
GRASS GIS <https://grass.osgeo.org>

#3966: Batch job examples: add GRASS_PAGER=cat to avoid getting stuck expecting a
terminal
--------------------------+---------------------------------
  Reporter: jidanni | Owner: grass-dev@…
      Type: enhancement | Status: closed
  Priority: trivial | Milestone: 7.8.3
Component: Docs | Version: unspecified
Resolution: worksforme | Keywords: exec batch grass.py
       CPU: Unspecified | Platform: Unspecified
--------------------------+---------------------------------
Changes (by wenzeslaus):

* status: new => closed
* resolution: => worksforme

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3966#comment:7&gt;
GRASS GIS <https://grass.osgeo.org>