Unix Shell - ksh command line edit

This is Interesting: Free IT Magazines  
Home > Archive > Unix Shell > April 2004 > ksh command line edit





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author ksh command line edit
ajay

2004-04-08, 2:36 am

How to enable arrows key (left, right) and backspace (for delete) in
ksh for command line editing?

By default we have to use HJKL for moving around while editing on
command line

Tx
Ajay
Chris F.A. Johnson

2004-04-08, 3:37 am

On Thu, 08 Apr 2004 at 05:53 GMT, ajay wrote:
> How to enable arrows key (left, right) and backspace (for delete) in
> ksh for command line editing?
>
> By default we have to use HJKL for moving around while editing on
> command line


Probably:

set -o emacs

--
Chris F.A. Johnson http://cfaj.freeshell.org/shell
========================================
===========================
My code (if any) in this post is copyright 2004, Chris F.A. Johnson
and may be copied under the terms of the GNU General Public License
Kenny McCormack

2004-04-08, 10:54 am

In article <c52uvt$2oatbt$2@ID-210011.news.uni-berlin.de>,
Chris F.A. Johnson <c.fa.johnson@rogers.com> wrote:
>On Thu, 08 Apr 2004 at 05:53 GMT, ajay wrote:
>
> Probably:
>
>set -o emacs


Or, more likely to be actually helpful:

exec tcsh

(followed by: bindkey -v)

Anyway, assuming that the OP wants to stay in vi mode *and* in ksh, the
outlook is bleak. This question comes up frequently, and often
a "solution" is posted (something with "set" statements), but that
"solution" doesn't work (hence the quotes).

Dennis McCunney

2004-04-11, 3:31 pm

ajay wrote:

> How to enable arrows key (left, right) and backspace (for delete) in
> ksh for command line editing?
>
> By default we have to use HJKL for moving around while editing on
> command line


ksh offers command line editing in vi or eamcs modes. If you have to
use HJKL to move around, vi mode is turned on.

You can use emacs commands by typing set -o emacs at the command line,
but that just substitutes Control-<char> keystrokes for vi keystrokes.

I've seen "solutions" for ksh that use emacs mode and shell
functions/aliases, but they are flaky at best.

I would either

1) Learn to get comfortable in vi

or

2) Use bash instead of ksh, since bash binds edit commands to your arrow
keys by default.

> Tx
> Ajay

______
Dennis
Dan Mercer

2004-04-11, 3:31 pm


"Dennis McCunney" <dmccunney@NOSPAMnyc.rr.com> wrote in message news:FdIdc.9678$mX.3944967@twister.nyc.rr.com...
: ajay wrote:
:
: > How to enable arrows key (left, right) and backspace (for delete) in
: > ksh for command line editing?
: >
: > By default we have to use HJKL for moving around while editing on
: > command line
:
: ksh offers command line editing in vi or eamcs modes. If you have to
: use HJKL to move around, vi mode is turned on.
:
: You can use emacs commands by typing set -o emacs at the command line,
: but that just substitutes Control-<char> keystrokes for vi keystrokes.
:
: I've seen "solutions" for ksh that use emacs mode and shell
: functions/aliases, but they are flaky at best.
:
: I would either
:
: 1) Learn to get comfortable in vi
:
: or
:
: 2) Use bash instead of ksh, since bash binds edit commands to your arrow
: keys by default.

3) get ksh93 from www.kornshell.com which uses the arrow keys.

Dan Mercer

:
: > Tx
: > Ajay
: ______
: Dennis


ajay

2004-04-12, 9:44 am

I thought there will be a solution.
Anyway have to live with it.

Tx to all
Ajay
Markus Gyger

2004-04-12, 10:37 am

ajay <myhandle@lucent.com> writes:
> I thought there will be a solution.


You might take a look at http://dotfiles.com/?app_id=5


Markus
Walt Fles

2004-04-12, 5:38 pm

vi vi vi
the editor of the beast

ajay wrote:
> How to enable arrows key (left, right) and backspace (for delete) in
> ksh for command line editing?
>
> By default we have to use HJKL for moving around while editing on
> command line
>
> Tx
> Ajay


Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com