[comp.windows.open-look] ksh disable's scrolling in cmdtool

srm@Unify.Com (Steve Maraglia) (03/22/91)

I have a problem with the cmdtool/shelltool when accessing the history file
with the Korn shell. As soon as the "esc" key is hit, scrolling is disabled,
just as if you selected "Disable Scrolling" from the "Term Pane" menu.
Does anyone know how to get around this problem? Its very annoying!


-- 
Steve Maraglia - System Administrator	   internet: srm@unify.com
Unify Corporation			   ..!{uunet,csusac,pyramid}!unify!srm
3901 Lennane Dr.    Sacramento, CA 95834   (916) 928-6271

barnett@grymoire.crd.ge.com (Bruce Barnett) (03/22/91)

Perhaps this should be in the OpenLook FAQ:

In article <p9avi01@Unify.Com> srm@Unify.Com (Steve Maraglia) writes:

> I have a problem with the cmdtool/shelltool when accessing the history file
> with the Korn shell. As soon as the "esc" key is hit, scrolling is disabled,
> just as if you selected "Disable Scrolling" from the "Term Pane" menu.
> Does anyone know how to get around this problem? Its very annoying!

I don't think there is a solution with the current software.  With
cmdtool, you already have the ability to edit the command line using
emacs-like bindings. Or you can use the mouse to edit the command
line. It works with any program and does not require raw/cbreak/icanon
mode. 

By using ksh in a cmdtool window, you have two programs that are trying
to the same thing. Which one handles the Control-B command? It must be
cmdtool, because it doesn't know what the program running inside the
window does.

The only way programs like vi, emacs, etc work inside of cmdtool is
they send out the termcap(3) TI (terminal initialization) string.
This tells cmdtool to stop providing it's command line editing, and
turns off the scrollbar, which changes cmdtool into shelltool. (They
are really the same program).

You can manually do this with the Disable Scrolling in the menu, or by
the following alias:

alias ScrollOff '/usr/5bin/echo "\033[>4l\c"'

Turn it back on with:

alias ScrollOn '/usr/5bin/echo "\033[>4h\c"'

You can split the window, and have a scrollbar for past history in one
window, and disable scrolling in the other window.

This doesn't really work well, because the history of what is going on
in the window without scrolling isn't retained in the window with the
scrollbar.

The only other alternative is to use xterm, which does not provide 
mouse-based editing but does provide scrolling.

--
Bruce G. Barnett	barnett@crd.ge.com	uunet!crdgw1!barnett

wjc@hos1cad.ATT.COM (Bill Carpenter) (03/23/91)

srm> I have a problem with the cmdtool/shelltool when accessing the
srm> history file with the Korn shell. As soon as the "esc" key is
srm> hit, scrolling is disabled, just as if you selected "Disable
srm> Scrolling" from the "Term Pane" menu.  Does anyone know how to
srm> get around this problem? Its very annoying!

cmdtool/shelltool stty handling is a crock.  To the uninitiated, they
often make other programs look broken.  Luckily, in this instance,
there is an easy cure.  Assuming you're using "vi" mode of "ksh", just
do "set -o viraw".  (I'm assuming you're using "vi" mode because
that's where I've always seen this particular problem, never in emacs
mode.)
-- 
  Bill Carpenter         att!hos1cad!wjc  or  attmail!bill

srm@Unify.Com (Steve Maraglia) (03/25/91)

In article <BARNETT.91Mar22090051@grymoire.crd.ge.com> barnett@crdgw1.ge.com writes:
>Perhaps this should be in the OpenLook FAQ:
>

Yes, maybe it should!

>In article <p9avi01@Unify.Com> srm@Unify.Com (Steve Maraglia) writes:
>
>> I have a problem with the cmdtool/shelltool when accessing the history file
>> with the Korn shell. As soon as the "esc" key is hit, scrolling is disabled,
>> just as if you selected "Disable Scrolling" from the "Term Pane" menu.
>> Does anyone know how to get around this problem? Its very annoying!
>
>I don't think there is a solution with the current software.  With
>cmdtool, you already have the ability to edit the command line using
>emacs-like bindings. Or you can use the mouse to edit the command
>line. It works with any program and does not require raw/cbreak/icanon
>mode. 
>

If you want to use "vi" for command line editing (minor detail not mentioned
in my original post :-) )  insert "set -o viraw" in your .kshrc.

Thanks to those who responded!


-- 
Steve Maraglia - System Administrator	   internet: srm@unify.com
Unify Corporation			   ..!{uunet,csusac,pyramid}!unify!srm
3901 Lennane Dr.    Sacramento, CA 95834   (916) 928-6271