[GRASS-dev] [GRASS GIS] #3713: add powershell shell support to grass74.py

#3713: add powershell shell support to grass74.py
-------------------------+-------------------------
Reporter: pmolzer | Owner: grass-dev@…
     Type: enhancement | Status: new
Priority: normal | Milestone:
Component: Startup | Version: 7.4.2
Keywords: | CPU: Unspecified
Platform: MSWindows |
-------------------------+-------------------------
I have added powershell as a supported command shell to grass74.py. I
don't have SVN commit access and am not on the dev mailing list. Can I
just attach the script to this ticket, or should I request some sort of
access to SVN?

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

#3713: add powershell shell support to grass74.py
--------------------------+-------------------------
  Reporter: pmolzer | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: normal | Milestone:
Component: Startup | Version: 7.4.2
Resolution: | Keywords:
       CPU: Unspecified | Platform: MSWindows
--------------------------+-------------------------
Changes (by pmolzer):

* Attachment "grass74.py" added.

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

#3713: add powershell shell support to grass74.py
--------------------------+-------------------------
  Reporter: pmolzer | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: normal | Milestone:
Component: Startup | Version: 7.4.2
Resolution: | Keywords:
       CPU: Unspecified | Platform: MSWindows
--------------------------+-------------------------

Comment (by hellik):

could you add a diff of your changes instead of attaching the whole
script? Then it would be easier to see and evaluate the changes.

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

#3713: add powershell shell support to grass74.py
--------------------------+-------------------------
  Reporter: pmolzer | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: normal | Milestone:
Component: Startup | Version: 7.4.2
Resolution: | Keywords:
       CPU: Unspecified | Platform: MSWindows
--------------------------+-------------------------
Changes (by pmolzer):

* Attachment "grass.py.diff" added.

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

#3713: add powershell shell support to grass74.py
--------------------------+-------------------------
  Reporter: pmolzer | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: normal | Milestone:
Component: Startup | Version: 7.4.2
Resolution: | Keywords:
       CPU: Unspecified | Platform: MSWindows
--------------------------+-------------------------

Comment (by pmolzer):

I've attached a diff. I could not find grass74.py in the source but there
is grass.py, so I've modified that.

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

#3713: add powershell shell support to grass74.py
--------------------------+-------------------------
  Reporter: pmolzer | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: normal | Milestone:
Component: Startup | Version: 7.4.2
Resolution: | Keywords:
       CPU: Unspecified | Platform: MSWindows
--------------------------+-------------------------

Comment (by martinl):

In [changeset:"73814" 73814]:
{{{
#!CommitTicketReference repository="" revision="73814"
add powershell shell support to grass.py (see #3713)
         patch provided by pmolzer
}}}

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

#3713: add powershell shell support to grass74.py
--------------------------+-------------------------
  Reporter: pmolzer | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: normal | Milestone:
Component: Startup | Version: 7.4.2
Resolution: | Keywords:
       CPU: Unspecified | Platform: MSWindows
--------------------------+-------------------------

Comment (by martinl):

Slightly modified patch applied to trunk in r73814. Could you test next
(no. 348+) WinGRASS build [1]?

[1] https://wingrass.fsv.cvut.cz/grass77/x86_64/

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

#3713: add powershell shell support to grass74.py
--------------------------+-------------------------
  Reporter: pmolzer | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: normal | Milestone: 7.6.0
Component: Startup | Version: 7.4.2
Resolution: | Keywords:
       CPU: Unspecified | Platform: MSWindows
--------------------------+-------------------------
Changes (by martinl):

* milestone: => 7.6.0

Comment:

Target set to 7.6.0.

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

#3713: add powershell shell support to grass74.py
--------------------------+-------------------------
  Reporter: pmolzer | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: normal | Milestone: 7.6.0
Component: Startup | Version: 7.4.2
Resolution: | Keywords:
       CPU: Unspecified | Platform: MSWindows
--------------------------+-------------------------

Comment (by hellik):

Replying to [comment:2 pmolzer]:
> I've attached a diff. I could not find grass74.py in the source but
there is grass.py, so I've modified that.

please add some hints/examples in the GRASS wiki how to use windows
powershell in winGRASS. otherwise this functionality will be hidden for
the broader user base.

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

#3713: add powershell shell support to grass74.py
--------------------------+-------------------------
  Reporter: pmolzer | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: normal | Milestone: 7.6.0
Component: Startup | Version: 7.4.2
Resolution: | Keywords:
       CPU: Unspecified | Platform: MSWindows
--------------------------+-------------------------

Comment (by veroandreo):

Replying to [comment:6 hellik]:
> Replying to [comment:2 pmolzer]:
> > I've attached a diff. I could not find grass74.py in the source but
there is grass.py, so I've modified that.
>
> please add some hints/examples in the GRASS wiki how to use windows
powershell in winGRASS. otherwise this functionality will be hidden for
the broader user base.

+1!
This would be highly appreciated by those of us Linux users teaching with
command line to windows users.

Note also that you can edit this wiki:
https://grasswiki.osgeo.org/wiki/GRASS_and_windows_console

Thanks much in advance :slight_smile:

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

#3713: add powershell shell support to grass74.py
--------------------------+-------------------------
  Reporter: pmolzer | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: normal | Milestone: 7.6.0
Component: Startup | Version: 7.4.2
Resolution: | Keywords:
       CPU: Unspecified | Platform: MSWindows
--------------------------+-------------------------

Comment (by pmolzer):

will do. I've requested an account for the wiki and wait for approval.
Which of these places is the best to add some info?

[https://grasswiki.osgeo.org/wiki/GRASS_and_windows_console\]
[https://grasswiki.osgeo.org/wiki/GRASS_and_Shell\]

I'll put some content on use of the GRASS_SH environment variable.
maybe also mention the rather heavy escaping needed to call grass from
powershell. For example

{{{
v.extract input=$state"_Counties" where=`"COUNTY=`'"$ucnty"`'`"
output=$cntyname
}}}

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

#3713: add powershell shell support to grass74.py
--------------------------+-------------------------
  Reporter: pmolzer | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: normal | Milestone: 7.6.0
Component: Startup | Version: 7.4.2
Resolution: | Keywords:
       CPU: Unspecified | Platform: MSWindows
--------------------------+-------------------------

Comment (by veroandreo):

I think that the GRASS and Windows console wiki is a good start. I'm not
aware of ppl using powershell in Linux, but in any case, we could
eventually move the content or just put a link "for powershell usage see
here..." in the GRASS and shell wiki.

Thanks much!

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

#3713: add powershell shell support to grass74.py
--------------------------+-------------------------
  Reporter: pmolzer | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: normal | Milestone: 7.6.0
Component: Startup | Version: 7.4.2
Resolution: | Keywords:
       CPU: Unspecified | Platform: MSWindows
--------------------------+-------------------------

Comment (by pmolzer):

done. also noticed a feature request to add support for the linux
subsystem for windows. I gave it a try but its not as simple as it seems.

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

#3713: add powershell shell support to grass74.py
--------------------------+-------------------------
  Reporter: pmolzer | Owner: grass-dev@…
      Type: enhancement | Status: closed
  Priority: normal | Milestone: 7.6.2
Component: Startup | Version: 7.4.2
Resolution: fixed | Keywords:
       CPU: Unspecified | Platform: MSWindows
--------------------------+-------------------------
Changes (by wenzeslaus):

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

Comment:

This seems to be already added in r73814. No remaining issues obvious from
comments. Closing as fixed. Please, open a new issue on !GitHub if you
need to follow up.

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