[GRASS-dev] Mac xterm wrapper problem with wxgrass

William,

I just had a chance to test the Mac xterm wrapper–that uses the terminal rather than an xterm–in wxgrass. It hangs on exit, but it may be the way the command is issued.

$GISBASE/etc/grass-xterm-wrapper -name xterm-grass -e $GISBASE/etc/grass-run.sh [command]

Is this OK for the Mac wrapper?

It works fine with TclTk.

Michael


Michael Barton, Professor of Anthropology
Director of Graduate Studies
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton

I thought you were going to work out some sort of Python way to handle the need for an xterm? Or have you gotten that far yet?

In all the tcl scripts I found that use it, it looks like they all terminate the [command] with &.

Question: is that on PPC or Intel or both? I've noticed a problem with grass-xterm-wrapper on PPC - after running GRASS.app once, future runs fail unless Terminal.app is quit first. It's strange because it doesn't always happen, but I think it has something to do with AppleScript. ie:

double-click GRASS.app
Terminal starts
grass.sh runs in new Terminal window and Tcl GUI starts
GRASS.app quits
select mapset

double-click GRASS.app again
Terminal activates
grass.sh runs in new Terminal window and Tcl GUI starts (2 running now)
GRASS.app quits
click the Define location with projection values button, so it uses grass-xterm-wrapper to run set_data in a new Terminal window

quit all running grass shells, but leave Terminal.app running.

double-click GRASS.app again
Terminal activates
[grass.sh does NOT run]
GRASS.app quits

There are also random cases where grass-xterm-wrapper starts a Terminal window, but never runs the [command] - kinda similar to your problem. Hmmm.

It all works fine on my MacBook.

I asked the Applescript list earlier in the week but haven't heard anything yet (it's an awfully quiet list...).

I have a couple things I'm going to try. But I may have to revert grass-xterm-wrapper if I can't figure out what's wrong.

On Jun 23, 2007, at 7:53 PM, Michael Barton wrote:

William,

I just had a chance to test the Mac xterm wrapper--that uses the terminal rather than an xterm--in wxgrass. It hangs on exit, but it may be the way the command is issued.

$GISBASE/etc/grass-xterm-wrapper -name xterm-grass -e $GISBASE/etc/grass-run.sh [command]

Is this OK for the Mac wrapper?

It works fine with TclTk.

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

All generalizations are dangerous, even this one.

Hi William,

I'm only using an xterm as a stop-gap until a few remaining commands can be
'liberated' from the xterm. There is no plan that I know of to create a
Python version of an xterm. Besides the command line parser that we now
have, a Python terminal (i.e., it would process Python commands) has been
discussed.

My system is an Intel. Once I did have trouble starting the terminal, but it
worked OK all other times. The only problem is when I've tried to quit. It
leaves the wxPython locked up and I have to kill it--as if it were still
running modally.

Like I said, it works fine for me in TclTk. I'll keep trying a few things in
wxPython too and see if there is some way to deal with it.

Michael

On 6/23/07 7:31 PM, "William Kyngesburye" <woklist@kyngchaos.com> wrote:

I thought you were going to work out some sort of Python way to
handle the need for an xterm? Or have you gotten that far yet?

In all the tcl scripts I found that use it, it looks like they all
terminate the [command] with &.

Question: is that on PPC or Intel or both? I've noticed a problem
with grass-xterm-wrapper on PPC - after running GRASS.app once,
future runs fail unless Terminal.app is quit first. It's strange
because it doesn't always happen, but I think it has something to do
with AppleScript. ie:

double-click GRASS.app
Terminal starts
grass.sh runs in new Terminal window and Tcl GUI starts
GRASS.app quits
select mapset

double-click GRASS.app again
Terminal activates
grass.sh runs in new Terminal window and Tcl GUI starts (2 running now)
GRASS.app quits
click the Define location with projection values button, so it uses
grass-xterm-wrapper to run set_data in a new Terminal window

quit all running grass shells, but leave Terminal.app running.

double-click GRASS.app again
Terminal activates
[grass.sh does NOT run]
GRASS.app quits

There are also random cases where grass-xterm-wrapper starts a
Terminal window, but never runs the [command] - kinda similar to your
problem. Hmmm.

It all works fine on my MacBook.

I asked the Applescript list earlier in the week but haven't heard
anything yet (it's an awfully quiet list...).

I have a couple things I'm going to try. But I may have to revert
grass-xterm-wrapper if I can't figure out what's wrong.

On Jun 23, 2007, at 7:53 PM, Michael Barton wrote:

William,

I just had a chance to test the Mac xterm wrapper--that uses the
terminal rather than an xterm--in wxgrass. It hangs on exit, but it
may be the way the command is issued.

$GISBASE/etc/grass-xterm-wrapper -name xterm-grass -e $GISBASE/etc/
grass-run.sh [command]

Is this OK for the Mac wrapper?

It works fine with TclTk.

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

All generalizations are dangerous, even this one.

__________________________________________
Michael Barton, Professor of Anthropology
Director of Graduate Studies
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton

I have a possible fix in CVS for this. I simplified the AppleScript/shell setup - where there were 2 wait loops, there is only one. Also fixed a couple other small problems.

BUT, there is still the problem on PPC where once grass-xterm-wrapper runs, a new GRASS.app will not run until Terminal.app is quit (and thus all other running GRASS sessions).

On Jun 23, 2007, at 7:53 PM, Michael Barton wrote:

William,

I just had a chance to test the Mac xterm wrapper--that uses the terminal rather than an xterm--in wxgrass. It hangs on exit, but it may be the way the command is issued.

$GISBASE/etc/grass-xterm-wrapper -name xterm-grass -e $GISBASE/etc/grass-run.sh [command]

Is this OK for the Mac wrapper?

It works fine with TclTk.

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

"This is a question about the past, is it? ... How can I tell that the past isn't a fiction designed to account for the discrepancy between my immediate physical sensations and my state of mind?"

- The Ruler of the Universe

Thanks William.

On 6/25/07 5:38 PM, "William Kyngesburye" <woklist@kyngchaos.com> wrote:

I have a possible fix in CVS for this. I simplified the AppleScript/
shell setup - where there were 2 wait loops, there is only one. Also
fixed a couple other small problems.

BUT, there is still the problem on PPC where once grass-xterm-wrapper
runs, a new GRASS.app will not run until Terminal.app is quit (and
thus all other running GRASS sessions).

I don't think this is a real problem. On other systems, you can only have
one GRASS session running at a time.

Michael

On Jun 23, 2007, at 7:53 PM, Michael Barton wrote:

William,

I just had a chance to test the Mac xterm wrapper--that uses the
terminal rather than an xterm--in wxgrass. It hangs on exit, but it
may be the way the command is issued.

$GISBASE/etc/grass-xterm-wrapper -name xterm-grass -e $GISBASE/etc/
grass-run.sh [command]

Is this OK for the Mac wrapper?

It works fine with TclTk.

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

"This is a question about the past, is it? ... How can I tell that
the past isn't a fiction designed to account for the discrepancy
between my immediate physical sensations and my state of mind?"

- The Ruler of the Universe

__________________________________________
Michael Barton, Professor of Anthropology
Director of Graduate Studies
School of Human Evolution & Social Change
Center for Social Dynamics and Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton

On Jun 25, 2007, at 7:50 PM, Michael Barton wrote:

BUT, there is still the problem on PPC where once grass-xterm-wrapper
runs, a new GRASS.app will not run until Terminal.app is quit (and
thus all other running GRASS sessions).

I don't think this is a real problem. On other systems, you can only have
one GRASS session running at a time.

Actually, I think you can. Just not more than one in the same mapset.

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

"Those people who most want to rule people are, ipso-facto, those least suited to do it."

- A rule of the universe, from the HitchHiker's Guide to the Galaxy

Oops. I spoke too soon. It still hangs.

Here is what I'm doing to test it. I start r.digit from the wxgrass menu. It
launches an xmonitor and terminal properly. Then I hit return to cancel. The
program shuts down, but I get a spinning beach ball with the wxgrass GUI,
and have to force quite wxPython.

Michael

On 6/25/07 6:51 PM, "William Kyngesburye" <woklist@kyngchaos.com> wrote:

On Jun 25, 2007, at 7:50 PM, Michael Barton wrote:

BUT, there is still the problem on PPC where once grass-xterm-wrapper
runs, a new GRASS.app will not run until Terminal.app is quit (and
thus all other running GRASS sessions).

I don't think this is a real problem. On other systems, you can
only have
one GRASS session running at a time.

Actually, I think you can. Just not more than one in the same mapset.

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

"Those people who most want to rule people are, ipso-facto, those
least suited to do it."

- A rule of the universe, from the HitchHiker's Guide to the Galaxy

__________________________________________
Michael Barton, Professor of Anthropology
Director of Graduate Studies
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton

Ah, that sort of hang. I gave it a try, and it looks like the 'osascript' I use is not exiting (use Activity Monitor and show All Processes Hierarchically, and you can see it under Python). Quitting osascript (no need to force quit it) returns to Python.

And I verified that setting GRASS_XTERM=xterm, d.rast.edit does return control to Python.

hmmm....

Ah, that's got it! I was saving the name of the application that initiates grass-xterm-wrapper so I could activate it when it finishes, otherwise the Terminal is left active. While X11/TclTk seems to be OK with this, Python is not. For some reason it stalls between closing the Terminal window and activating Python.

For now I disabled the reactivation of the calling app until I can figure out how to get Python to like it. In CVS now.

On Jun 25, 2007, at 9:53 PM, Michael Barton wrote:

Oops. I spoke too soon. It still hangs.

Here is what I'm doing to test it. I start r.digit from the wxgrass menu. It
launches an xmonitor and terminal properly. Then I hit return to cancel. The
program shuts down, but I get a spinning beach ball with the wxgrass GUI,
and have to force quite wxPython.

Michael

On 6/25/07 6:51 PM, "William Kyngesburye" <woklist@kyngchaos.com> wrote:

On Jun 25, 2007, at 7:50 PM, Michael Barton wrote:

BUT, there is still the problem on PPC where once grass-xterm-wrapper
runs, a new GRASS.app will not run until Terminal.app is quit (and
thus all other running GRASS sessions).

I don't think this is a real problem. On other systems, you can
only have
one GRASS session running at a time.

Actually, I think you can. Just not more than one in the same mapset.

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

"Those people who most want to rule people are, ipso-facto, those
least suited to do it."

- A rule of the universe, from the HitchHiker's Guide to the Galaxy

__________________________________________
Michael Barton, Professor of Anthropology
Director of Graduate Studies
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

"We are at war with them. Neither in hatred nor revenge and with no particular pleasure I shall kill every ___ I can until the war is over. That is my duty."

"Don't you even hate 'em?"

"What good would it do if I did? If all the many millions of people of the allied nations devoted an entire year exclusively to hating the ____ it wouldn't kill one ___ nor shorten the war one day."

<Ha, ha> "And it might give 'em all stomach ulcers."

- Tarzan, on war

On 6/25/07 8:48 PM, "William Kyngesburye" <woklist@kyngchaos.com> wrote:

Ah, that sort of hang. I gave it a try, and it looks like the
'osascript' I use is not exiting (use Activity Monitor and show All
Processes Hierarchically, and you can see it under Python). Quitting
osascript (no need to force quit it) returns to Python.

And I verified that setting GRASS_XTERM=xterm, d.rast.edit does
return control to Python.

hmmm....

Ah, that's got it! I was saving the name of the application that
initiates grass-xterm-wrapper so I could activate it when it
finishes, otherwise the Terminal is left active. While X11/TclTk
seems to be OK with this, Python is not. For some reason it stalls
between closing the Terminal window and activating Python.

For now I disabled the reactivation of the calling app until I can
figure out how to get Python to like it. In CVS now.

That did it! Thanks.

Michael

On Jun 25, 2007, at 9:53 PM, Michael Barton wrote:

Oops. I spoke too soon. It still hangs.

Here is what I'm doing to test it. I start r.digit from the wxgrass
menu. It
launches an xmonitor and terminal properly. Then I hit return to
cancel. The
program shuts down, but I get a spinning beach ball with the
wxgrass GUI,
and have to force quite wxPython.

Michael

On 6/25/07 6:51 PM, "William Kyngesburye" <woklist@kyngchaos.com>
wrote:

On Jun 25, 2007, at 7:50 PM, Michael Barton wrote:

BUT, there is still the problem on PPC where once grass-xterm-
wrapper
runs, a new GRASS.app will not run until Terminal.app is quit (and
thus all other running GRASS sessions).

I don't think this is a real problem. On other systems, you can
only have
one GRASS session running at a time.

Actually, I think you can. Just not more than one in the same
mapset.

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

"Those people who most want to rule people are, ipso-facto, those
least suited to do it."

- A rule of the universe, from the HitchHiker's Guide to the Galaxy

__________________________________________
Michael Barton, Professor of Anthropology
Director of Graduate Studies
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

"We are at war with them. Neither in hatred nor revenge and with no
particular pleasure I shall kill every ___ I can until the war is
over. That is my duty."

"Don't you even hate 'em?"

"What good would it do if I did? If all the many millions of people
of the allied nations devoted an entire year exclusively to hating
the ____ it wouldn't kill one ___ nor shorten the war one day."

<Ha, ha> "And it might give 'em all stomach ulcers."

- Tarzan, on war

__________________________________________
Michael Barton, Professor of Anthropology
Director of Graduate Studies
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton