[comp.sys.hp] Something useful for a change

bb@reef.cis.ufl.edu (Brian Bartholomew) (10/30/90)

> From: jad@hpcndnm.cnd.hp.com (John Dilley)

> BTW, I was interested to hear that Sun's vi did not obey the SIGWINCH
> signal ... I always assumed they had fixed vi since they had
> SIGWINCH...

Nope, Sun got lazy.

-----

> The easiest way to get vi to scale to a non-80x24 terminal window on
> HP-UX systems, prior to starting vi (just like on your favorite
> system) is:
>
> $ eval `resize`

I would be happier to see the code that resize performs (a termcap
inquiry and a couple setenv's?) added to the tcsh.  Since there is no
SIGWINCH to catch, tcsh could just unconditionally perform the code
each time it printed a prompt.  My understanding is that tcsh is
already dependent on termcap now, anyway, for editing purposes.  Any
takers?


"Any sufficiently advanced technology is indistinguishable from a rigged demo."
-------------------------------------------------------------------------------
Brian Bartholomew	UUCP:       ...gatech!uflorida!mathlab.math.ufl.edu!bb
University of Florida	Internet:   bb@math.ufl.edu
--
"Any sufficiently advanced technology is indistinguishable from a rigged demo."
-------------------------------------------------------------------------------
Brian Bartholomew	UUCP:       ...gatech!uflorida!mathlab.math.ufl.edu!bb
University of Florida	Internet:   bb@math.ufl.edu

dave@dptechno.UUCP (Dave Lee) (11/01/90)

In article <25191@uflorida.cis.ufl.EDU> bb@reef.cis.ufl.edu (Brian Bartholomew) writes:
>> $ eval `resize`
>
>I would be happier to see the code that resize performs (a termcap
>inquiry and a couple setenv's?) added to the tcsh.  Since there is no
>SIGWINCH to catch, tcsh could just unconditionally perform the code
>each time it printed a prompt.  My understanding is that tcsh is
>already dependent on termcap now, anyway, for editing purposes.  Any
>takers?

Absolutely NOT !

The way resize works is by sending an inquire string to the window/terminal
and waiting for a response.  The window/terminal then sends back some string
that says what the current window size is.
However, if there is already typeahead in the input buffer then resize
gets really confused, or if you type something in echo mode while
resize is sending its inquire string, the window gets intermixed characters
and gets really confused.   

The only way to have this not happen is to set the terminal to raw, noecho 
mode, flush any typeahead, then hope the user doesnt type anything.
Not acceptable. (to me atleast).  Just try putting eval `resize` in your
.login for an xterm and then do a rlogin localhost and type something before
the resize is done (after the login messages).  Yuck.


 

-- 
Dave Lee
uunet!dptechno!dave

bb@reef.cis.ufl.edu (Brian Bartholomew) (11/02/90)

In article <25191@uflorida.cis.ufl.EDU> bb@reef.cis.ufl.edu
(Brian Bartholomew) writes:

> How about putting the "resize" code in tcsh?

In article <603@dptechno.UUCP> dave@dptechno.UUCP (Dave Lee) writes:

> No, that's a really bad idea, as resize gets the data from xterm
> via an escape sequence, and you'll make a mess.


Well, ok, punt.

How about having xterm itself make the mods to the tcsh's
environmental strings.  Does the environment scoping allow this?  Will
the programs the shell runs see the changed environment?

Xterm source that compiles under this environment should not be
impossible to get.


"Any sufficiently advanced technology is indistinguishable from a rigged demo."
-------------------------------------------------------------------------------
Brian Bartholomew	UUCP:       ...gatech!uflorida!mathlab.math.ufl.edu!bb
University of Florida	Internet:   bb@math.ufl.edu
--
"Any sufficiently advanced technology is indistinguishable from a rigged demo."
-------------------------------------------------------------------------------
Brian Bartholomew	UUCP:       ...gatech!uflorida!mathlab.math.ufl.edu!bb
University of Florida	Internet:   bb@math.ufl.edu

jad@hpcndnm.cnd.hp.com (John Dilley) (11/03/90)

In article <25226@uflorida.cis.ufl.EDU> bb@reef.cis.ufl.edu (Brian Bartholomew) writes:

> How about having xterm itself make the mods to the tcsh's
> environmental strings.  Does the environment scoping allow this?  Will
> the programs the shell runs see the changed environment?
> 
> Xterm source that compiles under this environment should not be
> impossible to get.

	Hey, even *more* good news for a change!	:-)	The
hpterm on my system understands the -geometry argument and automatically
sets the $LINES and $COLUMNS environment variables.  I just did a
$ hpterm -geometry 90x50
and was able to "vi" without any problems.  Since I started hpterm from
a Gnu emacs *shell* mode buffer, however, I have no practical reason for
doing this, but I could	;-).

	I also just tried "xterm -geometry 90x50" and that worked too.
Are you running HP-UX 7.0?  Maybe you should try running ksh instead of
tcsh.  I'm not sure what tcsh provides, so I can't say what advantages
or disadvantages ksh offers as compared with tcsh.  Good luck in your
quest,

                          --      jad      --
			      John Dilley
			    Hewlett-Packard
                       Colorado Networks Division
UX-mail:      		     jad@cnd.hp.com
Phone:                       (303) 229-2787
--
This is not an official statement from Hewlett-Packard Corp., and does not
necessarily reflect the official position of HP.  The information above is
provided in good faith but completely without warranty of any kind.

jayavant@hpfcdj.HP.COM (Rajeev Jayavant) (11/03/90)

/ hpfcdj:comp.sys.hp / bb@reef.cis.ufl.edu (Brian Bartholomew) / 11:41 pm  Nov  1, 1990 /

>> How about having xterm itself make the mods to the tcsh's
>> environmental strings.  Does the environment scoping allow this?  Will
>> the programs the shell runs see the changed environment?

>> Xterm source that compiles under this environment should not be
>> impossible to get.

No can do.  The environment for a process cannot be accessed by any
other process.  Children inherit the environment from their parents
only because the child's initial environment is a copy of the parent's
environment (yeah, I know you can make the initial environment
different, but it's still a separate copy...).

If you really want to do something useful to xterm, modify it to send
a SIGWINDOW to the process group that is running under it.  If any
process in that group is smart enough to know what to do with a
SIGWINDOW, then you're in luck.  That means you'll have to hack up
tcsh to catch SIGWINDOW, query the terminal for its size, and set its
environment.  Ack!

Just use emacs in its own X window and avoid this whole mess :-).

							Rajeev
-------------------------------------------------------------------------------
Rajeev Jayavant (rajeev@hpfcla.hp.com)	      "Excuse me, I've lost my marbles"
Hewlett Packard - Graphics Technology Division        - P. Opus, [Bloom County]