[GRASS-dev] Re: [GRASS GIS] #1165: wingrass: cs2cs fails from the
msys command line
GRASS GIS
trac at osgeo.org
Wed Sep 22 07:29:06 EDT 2010
#1165: wingrass: cs2cs fails from the msys command line
---------------------------------+------------------------------------------
Reporter: hamish | Owner: grass-dev@…
Type: defect | Status: closed
Priority: normal | Milestone: 6.4.1
Component: Projections/Datums | Version: svn-develbranch6
Resolution: fixed | Keywords: cs2cs, wingrass
Platform: MSWindows XP | Cpu: x86-64
---------------------------------+------------------------------------------
Comment(by glynn):
Replying to [comment:6 hellik]:
> this should be edited as:
>
> (1) open OSGeo4W Shell (which is a windows-command-line with all
osgeo4w-utilities):
> {{{
> C:\>cs2cs +proj=latlong +datum=WGS84 +to +proj=latlong +datum=WGS84
+pm=madrid
> > 0 0
> 3d41'16.58"E 0dN 0.000
> }}}
>
> all works fine, '''but'''
>
> (2) open osgeo4w-msys-shell
> {{{
> syringia at NADA ~
> > $ cs2cs +proj=latlong +datum=WGS84 +to +proj=latlong +datum=WGS84
+pm=madrid
> 0 0
>
> }}}
>
> nothing happens, no computations of the new coordinates, a blank line is
waiting (I've waited about 10 minutes, but nothing happend)
>
> so maybe there are underlying problems of proj4/cs2cs in an (osgeo4w-
inherited) msys-environment?
This is really a problem with the Windows rxvt port (the "MSys terminal").
According to MSVCRT's isatty() function, a Windows console is a tty, while
rxvt isn't. stdin and stdout are line-buffered if it is associated with a
tty and fully-buffered otherwise. As rxvt isn't a tty, stdout is fully-
buffered, so you won't see any output from cs2cs until it either writes a
buffer's-worth of data or it terminates (i.e. when you press Ctrl-D).
The solution is not to use rxvt. The MSys project has basically disowned
it because of issues like this. Just run sh.exe in a Windows console.
FWIW, my "MSys" icon runs a batch file which sets PATH then executes:
{{{
start C:\msys\1.0\bin\sh.exe --login -i
}}}
Apart from the issue with rxvt not being a tty, it doesn't with the
pdcurses implementation which WinGRASS should be using. Unix curses
libraries are designed for traditional ttys, where cursor positioning,
colours, etc are selected using escape sequences, which don't work with
the Windows console. pdcurses uses the Windows console API
([http://msdn.microsoft.com/en-us/library/ms687404%28v=VS.85%29.aspx
WriteConsoleOutput] etc), and won't work with rxvt.
Oh; and rxvt is rather prone to crashing if you try to paste into it.
--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1165#comment:12>
GRASS GIS <http://grass.osgeo.org>
More information about the grass-dev
mailing list