Subject: command-line editing and "standard" shells.... (was: CVS commit: src)
To: NetBSD-current Discussion List <current-users@netbsd.org>
From: Greg A. Woods <woods@most.weird.com>
List: current-users
Date: 03/17/1999 22:56:58
[ On Wednesday, March 17, 1999 at 18:20:56 (-0400), David Maxwell wrote: ]
> Subject: Re: CVS commit: src
>
> But those features aren't enabled in the default config. Out of the box,
> csh is more friendly.

I don't believe a word of that!  ;-)

The only "friendly" feature that NetBSD's csh has (and one that I don't
normally associate with a plain old csh -- it was definitely news to me
yesterday!) is filename (and user-name) completion.  I'd vote for adding
it to sh (ksh already has filename completion, but I suppose it could
use user-name completion), though I'm unlikely to do the S.M.O.P.
necessary.

I think it's rather silly to try and claim that command-line editing
isn't "enabled out of the box".  With pd-ksh (i.e. NetBSD's ksh) in
particular the setting of VISUAL (or EDITOR) controls the selection of
command-line editing (i.e. if you do "VISUAL=vi" you'll implicily get a
"set -o vi" at the same time).  This feature could be added to sh, I
guess, but without it there's no safe way to enable one or the other by
default and yet avoid the religious implications of making such a
choice.

It's down-right wrong to claim that sh or ksh command-line editing have
any specific leaning towards emacs.  It's just as easy to say "set -o
vi" in either shell.  If you want an emacs bent I think a look at the
default tcsh bindings will be more fitting with your expectations.  I've
not yet met a VI user who's had any major complaints about ash or ksh
command-line editing.

> Perhaps we can redirect this discussion to decide which goals we are trying
> to meet with the shipped shell, then figure out which one meets them best.

I think Jason hit the nail on the head w.r.t. this:  /bin/sh (or even
now /bin/ksh) is a standards compliant shell -- this meets extremely
well with the already well defined and seemingly well accepted goal that
NetBSD be as "standards compliant" as is sanely possible for it to be.

> Isn't cursor-up for previous command more intuitive than ^A ?

And that's exactly the way /bin/sh works.  It's also why I've had the
magic cursor-key aliases in my ~/.kshrc for nearly a decade now (real
ksh doesn't normally automatically interpret cursor keys).

> I disagree. Following 'immediate consistency' could cause things to flip
> back and forth as various changes are made in the system as a whole.
> I'd rather see fewer things changed without good cause, rather than
> things changed and then changed back and changed again and....

It depends on your goals I guess.  I'd rather see an entire
self-consistent system even if it changes drastically on all facets from
(major) release to (major) release.  That's one of the nice things about
NetBSD -- it's very self consistent already, and is furthermore very
self consistent across all supported platforms.

> sh is the most basic shell on the system (rc is a package.) and it seems
> best suited for maintainence. I really don't want someone executing history
> recall commands in single user mode.

I sure do!  I think it means power users will be far less likely to make
silly mistakes.

> Hmm, I disklabeled the disk, and restored
> the data onto it. Then I did checked the disk free space, then... then
> he does a !d, and wipes the volume again because he really didn't do a df
> before, etc. In single user mode, you're there to fix things that can't
> be safely done in multi-user mode.

That's a problem with csh-style history, not with proper command-line
editing where you always get to see what you'll execute before you hit
return.

> btw, why are we arguing about root's shell when the default install says
> "Don't login as root, use su!"

I've definitely no argument against that!  ;-)

-- 
							Greg A. Woods

+1 416 218-0098      VE3TCP      <gwoods@acm.org>      <robohack!woods>
Planix, Inc. <woods@planix.com>; Secrets of the Weird <woods@weird.com>