Backspace over command line prompt

Backspace over command line prompt

Post by Simon McClenaha » Thu, 03 Jun 1999 04:00:00



This has been driving me nuts for at least a year now. When I telnet to a SCO 5
machine and login to an account with ksh as the shell and vi command-line
editing (set -o vi), I type away merrily at the command line, then
backspace/delete what I typed, but I can continue to backspace/delete over my
command line prompt. This happens regardless of my terminal emulator set to ansi
or vt100.

I generally have the following executed when I login:

os=`uname -s`
# Terminal Configuration
if [[ "$os" = SCO* ]] ; then
    eval `tset -m scoansi:${TERM:-scoansi} -m :${TERM:-ansi} -r -s -Q`
fi
eval `resize`
stty istrip erase "^h" kill "^u" intr "^c"
# If job control is enabled, set the suspend character to ^Z (control-z):
case $- in
*m*)    stty susp '^z'
        ;;
esac

I noticed that if I "set -o emacs" , there is no problem. If I "set -o vi" ,
press Escape then the "a" key to start typing in text, I am unable to backspace
past the beginning of the command-line. If I backspace over the prompt, then
press Escape, the prompt line is refreshed and displayed correctly.

I have only ever had this happen to me on SCO systems. My current system is SCO
OpenServer(TM) Release 5.

$ uname -a
SCO_SV devsco18 3.2 5.0.5 i386

Any clue as to what is going on here? Is ksh in vi mode broken on SCO? Is there
a fix for this nagging problem?

cheers,
--
Simon McClenahan
Computer Consultant Extraordinaire
BALR Corporation http://www.balr.com
+1(630)575-8200

 
 
 

Backspace over command line prompt

Post by Tony Earnsha » Fri, 04 Jun 1999 04:00:00



> Any clue as to what is going on here? Is ksh in vi mode broken on SCO? Is there
> a fix for this nagging problem?

SCO Open Server, at least, has always had this useful feature. It's for
if you don't like the prompt you're given, then you can choose your own
(it _was_ invented in a lon-gone period when people had more time to
spare, since one has to do it each time one presses enter).

If you want to avoid setting your own prompt, the one good way of
avoiding having to, is not to backspace over the prompt that SCO has
given you.

Tony

--
************* THE NEW DIMENSION IN DISTRIBUTION ***********
  ilion Faculty B.V.

  Randstad 21-57
  1314 BH  Almere-Stad          tel: +31 (0) 36 548 50 10
  The Netherlands               fax: +31 (0) 36 534 05 34
***************** http://www.ilion.nl *********************

 
 
 

Backspace over command line prompt

Post by brian hile » Sat, 05 Jun 1999 04:00:00



Quote:> This has been driving me nuts for at least a year now. When I telnet to a SCO
> machine and login to an account with ksh as the shell and vi command-line
> editing (set -o vi), I type away merrily at the command line, then
> backspace/delete what I typed, but I can continue to backspace/delete over my
> command line prompt. This happens regardless of my terminal emulator set to
> ansi or vt100.
> *m*)    stty susp '^z'

Stty on modern Unices is a merging of the code development lineages
of both the System V stty(1) and the BSD 4.3 stty(1). Only the BSD
stty(1) added the ability to specially recognize the prompt as an
inviolate portion of the command line (which I think is a peachy
idea, but IMHO just ain't so.)

Although I have not used your system nor tested my hypothesis on
one, except for the fact that emacs mode works and vi mode doesn't
(why, I don't know!) the problem you describe cannot derive from
any other aspect.

Use: stty crt susp ^Z

You may need to specify "newcrt" or "line 1" instead of "crt".

Quote:> Any clue as to what is going on here? Is ksh in vi mode broken
> on SCO? Is there a fix for this nagging problem?

This is Unix! Of course there is a fix! The strength of Unix is
it's configurability (and the weakness of Unix is it's configurability!)

Have you tried setting the "viraw" shell option?

set -o viraw -o vi

-Brian

 
 
 

Backspace over command line prompt

Post by Simon McClenaha » Sat, 05 Jun 1999 04:00:00



Quote:> This is Unix! Of course there is a fix! The strength of Unix is
> it's configurability (and the weakness of Unix is it's configurability!)

> Have you tried setting the "viraw" shell option?

> set -o viraw -o vi

This "fixed" it, thanks! My mind is at peace now, maybe I'll get some sleep at
night!

I did not try all the other informative stuff with stty in your message, so I
guess this "fix" is really a work-around to my problem rather than a solution to
the cause of it. If I was to use /bin/sh , my guess is I would have to try your
stty suggestions. FYI, I could not find the crt or newcrt options to stty in the
man page on Solaris. I still don't fully understand what the line parameter does
either.

Again, thank you.

cheers,
--
Simon McClenahan
Computer Consultant Extraordinaire
BALR Corporation http://www.balr.com
+1(630)575-8200