how do I get my arrow keys to work for looking thru my PREVIOUS UNIX COMMANDS


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers how do I get my arrow keys to work for looking thru my PREVIOUS UNIX COMMANDS
# 8  
Old 06-09-2005
Only very recent versions of ksh automatically support arrow keys. For early versions, try this:
Code:
set -o emacs
case "$TERM" in
xterm*|dec-vt220|vt100)
    alias __A=^P
    alias __B=^N
    alias __C=^F
    alias __D=^B
    ;;
hpterm|hp|700*)
    alias _A=^P
    alias _B=^N
    alias _C=^F
    alias _D=^B
esac

Note that ^P = a control P
# 9  
Old 06-09-2005
I think pdksh (the Public Domain Korn Shell) also supports arrow key scrolling automatically....

Perderabo - do you know of any way to alias arrow keys in vi-mode?

Cheers
ZB
# 10  
Old 06-09-2005
Quote:
Originally Posted by zazzybob
I think pdksh (the Public Domain Korn Shell) also supports arrow key scrolling automatically....

Perderabo - do you know of any way to alias arrow keys in vi-mode?

Cheers
ZB
I think you can use 'map', but I don't remember the details...
# 11  
Old 06-09-2005
This trick won't work in vi mode. The problem is shifting between command mode and input mode in vi. Emacs sidesteps the issue by not having modes. So it's emacs or nothing. I would love to be proven wrong though. Smilie
# 12  
Old 09-14-2005
Hi everyone ..

after reading this i am still confused with so many answers can anyone help me out.

I am working on Korn shell and cannot scroll thru previous commands using arrow keys. I even not able to edit the commands on the cmd propmt. i have to erase the whole cmd for editing it. is thr any way out.

I am using SSH secure shell for login...

Thanks
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

UP arrow button to recall previous commands in Putty

Hi, I remember in my previous project, I used UP arrow button to recall previous unix commands (using putty on Sun OS), which I am not able to do in my new project... I do not know if this is some project specific settings or not... when I press UP arrow button, all I get is ^. I have to... (3 Replies)
Discussion started by: juzz4fun
3 Replies

2. UNIX for Dummies Questions & Answers

Arrow keys binding in AIX v5.3 - how?

Would somebody advise how arrow keys could be binded in AIX v5.3? I could not find reasonable information online related to AIX. I've meat advises to define: alias __A=$'\020' # or the same: alias __A=$(echo "\020") alias __B=$'\016' alias __C=$'\006' alias __D=$'\002' But it does... (2 Replies)
Discussion started by: alex_5161
2 Replies

3. UNIX for Dummies Questions & Answers

Tux-HJKL as arrow keys

I would like to configure the key combination Tux-J (Win-J) as Down Arrow, and the rest of the VIM-style movement keys as well (HKL). What is the best way to do this so that it will work in all applications? I thought about editing the keyboard layout but I'm not sure how to do that for Tux-key... (2 Replies)
Discussion started by: dotancohen
2 Replies

4. Shell Programming and Scripting

Using arrow keys in shell scripts

I recently needed to collect arrow keys (and function keys etc.) in a shell script so that I could run a text graphics-style data entry system (with text entry fields, drop-down list boxes, progress bars and the like). Yes you can do all this in shell, and portably too if you're careful. I've... (4 Replies)
Discussion started by: cambridge
4 Replies

5. UNIX for Dummies Questions & Answers

SunOS 5.10 - VI Arrow keys not working

Hi I am working on SunOS 5.10 from remote terminal using putty. Also echo $TERM xterm In vi editor when in insert mode arrow keys are not working for cursor movement instead they print A B C and D. Please help. thanks ravs (7 Replies)
Discussion started by: ravashingravi
7 Replies

6. UNIX and Linux Applications

command scrolling using arrow keys

hi, can anyone tell me how to enable arrow keys to scroll thru the commands on command prompt. I am using C shell ( I know, in k shell, set -o vi would enable vi command history, but set -o doesnte exist in c shell) (4 Replies)
Discussion started by: hemangi13
4 Replies

7. Solaris

Using arrow keys

Hello, I am unable to use the arrow keys in some applications. For example, in bash, I am able to use the arrow keys to to go back and forth characters in current line and search the history--I can do everything you'd expect to be able to do with the arrow keys. However, in bc, I cannot use... (4 Replies)
Discussion started by: cooldude
4 Replies

8. Shell Programming and Scripting

How to read arrow keys on really old bash?

I would like to get a script to respond to arrow key presses to scroll up and down a menu. The platform is CDLinux which uses a prehistoric version of bash, version 1.14.7. I would like to do something like "read -sn 1 keyin" but the "read" command is so primative that it only has the -r... (1 Reply)
Discussion started by: simonb
1 Replies

9. UNIX for Dummies Questions & Answers

arrow keys / special keys

how to use the arrow keys in shell scripting. is there any special synatax / command for this. i just want to use the arrow keys for navigation. replies appreciated raguram R (3 Replies)
Discussion started by: raguramtgr
3 Replies

10. Shell Programming and Scripting

Trapping Arrow keys

Hey Guys , How do we trap the arrow keys in shell programming. Or atleast can we read the ascii code of the arrow keys. I want to read the arrow keys pressed by the user and accordingly highlight the corresponding menu option. Is it possible in shell to do so ?? ... (1 Reply)
Discussion started by: nageshrc
1 Replies
Login or Register to Ask a Question