[comp.windows.x] Help: xon executed from menus doesn't work

cherny@abacus.Colorado.EDU (Stacey Cherny) (01/05/91)

I've been having a very strange problem with X11R4, xdm,
and xon executed from a menu and would really appreciate
any insights into this problem that anybody may have.  Here is
the problem:

I've defined various commands to be executed from the pop-up up
menus which I've set in my .twmrc (and .mwmrc) file(s).  All
commands work fine, except the ones which use xon.  So if I try
something like 'xon host xterm &' as a command from the menu,
nothing happens.  If I type this in an xterm, it works fine.
Commands with xon which appear in my .xsession file get ignored
also.  However, if I source the .xsession file from an xterm,
those commands work.  This problem does not occur when I'm
running the same setup files under R3 on an Xstation, but only
occurs on displays which have xdm running on them.  The problem
occurs on a DECstation 2100 running R4 and an RS6000 running R3
but also using xdm.  It didn't occur on the IBM 6000 until I
installed xdm.  It doesn't occur on a DECstation which is running
DEC's R3 server and Xprompter.

If anybody has any ideas, I would really appreciate hearing them.

Thanks.

gildea@expo.lcs.mit.EDU (Stephen Gildea) (01/07/91)

    Date: 5 Jan 91 03:42:37 GMT
    From: cherny@abacus.colorado.edu (Stacey Cherny)
    Subject: Help: xon executed from menus doesn't work
    
    I've defined various commands to be executed from the pop-up up
    menus which I've set in my .twmrc (and .mwmrc) file(s).  All
    commands work fine, except the ones which use xon.  So if I try
    something like 'xon host xterm &' as a command from the menu,
    nothing happens.  If I type this in an xterm, it works fine.
    ...

You are probably not setting up your environment early enough.
Commands run from window manager menus run in the environment
that was in effect when the wm started.  In particular, you may
not have DISPLAY set in that environment.  "xon" needs DISPLAY
set.

 < Stephen

cherny@abacus.Colorado.EDU (Stacey Cherny) (01/08/91)

In article <1991Jan5.034237.5337@csn.org>, I write:
|> I've been having a very strange problem with X11R4, xdm,
|> and xon executed from a menu and would really appreciate
|> any insights into this problem that anybody may have.  Here is
|> the problem:
|> 
|> I've defined various commands to be executed from the pop-up up
|> menus which I've set in my .twmrc (and .mwmrc) file(s).  All
|> commands work fine, except the ones which use xon.  So if I try
|> something like 'xon host xterm &' as a command from the menu,
|> nothing happens.  If I type this in an xterm, it works fine.
|> Commands with xon which appear in my .xsession file get ignored
|> also.  However, if I source the .xsession file from an xterm,
|> those commands work.  This problem does not occur when I'm
|> running the same setup files under R3 on an Xstation, but only
|> occurs on displays which have xdm running on them.  The problem
|> occurs on a DECstation 2100 running R4 and an RS6000 running R3
|> but also using xdm.  It didn't occur on the IBM 6000 until I
|> installed xdm.  It doesn't occur on a DECstation which is running
|> DEC's R3 server and Xprompter.
|> 
|> If anybody has any ideas, I would really appreciate hearing them.
|> 
|> Thanks.
|> 

Well, the problem has been solved.  Thanks to all for the many
helpful suggestions.  It turned out that the problem was with xon
itself, in that in the rsh command that it ultimately executes,
it was redirecting output in an invalid way.  When I was running
xdm, the second exec below was beening executed, while when not
running xdm, the first one below was the one to be executed.  My
.xsession in run under /bin/csh and is only run when using xdm.
When xon was working, the SHELL was tcsh, when it wasn't, it was
csh.

 case ${SHELL-/bin/csh} in
   *csh )
     exec $rshell $host $rshopts -n \
       exec /bin/csh -cf "\"setenv DISPLAY $DISPLAY; setenv TERM xterm;\
                        exec $command\" < /dev/null >& /dev/null"
      ;;
   * )
     exec $rshell $host $rshopts -n \
       exec /bin/csh -cf "\"setenv DISPLAY $DISPLAY; setenv TERM xterm;\
                        exec $command\" < /dev/null > /dev/null 2>&1"
       ;;
    esac

Thanks again to all who responded.  

razdan@phx.mcd.mot.com (Anshuman Razdan) (01/11/91)

In article <9101071545.AA26972@excalibur.lcs.mit.edu> gildea@expo.lcs.mit.EDU (Stephen Gildea) writes:

   Path: mcdphx!asuvax!cs.utexas.edu!uunet!wuarchive!mit-eddie!bloom-beacon!dont-send-mail-to-path-lines
   From: gildea@expo.lcs.mit.EDU (Stephen Gildea)
   Newsgroups: comp.windows.x
   Date: 7 Jan 91 15:45:09 GMT
   Sender: daemon@athena.mit.edu (Mr Background)
   Organization: The Internet
   Lines: 19


       Date: 5 Jan 91 03:42:37 GMT
       From: cherny@abacus.colorado.edu (Stacey Cherny)
       Subject: Help: xon executed from menus doesn't work

       I've defined various commands to be executed from the pop-up up
       menus which I've set in my .twmrc (and .mwmrc) file(s).  All
       commands work fine, except the ones which use xon.  So if I try
       something like 'xon host xterm &' as a command from the menu,
       nothing happens.  If I type this in an xterm, it works fine.
       ...

   You are probably not setting up your environment early enough.
   Commands run from window manager menus run in the environment
   that was in effect when the wm started.  In particular, you may
   not have DISPLAY set in that environment.  "xon" needs DISPLAY
   set.

    < Stephen
------------------------- -------------------------

YOu may also want to use the -debug option in xon ( in the menu
entry which is probably f.exec "xon -debug ....". Start window
manager from a shell instead of login time (or kill the current
wm and restart) so as to get the out put of xon on the screen. It
should be apparent if you are missing any ENV variables.
--

Anshuman Razdan

************************************************************
* razdan@toy			Test and Methodology Group *
*							   *
* razdan@phx.mcd.mot.com	Diablo Plant, Tempe  Az    *
************************************************************