Solved

bind keys  bash

Posted on 2004-08-01
11
528 Views
Last Modified: 2013-12-09
Hi,

I want to use bash but when opening an xterm I have quite a lot of key missing/disfunctioning :

PageUPand PageDown keys don't work
Del key behaves like backspace, which I'd like to act as a Del key of course

I managed to make it work with zsh using bindkey, do you know how to do that with bash ?

Cheers
0
Comment
Question by:mikygee
  • 6
  • 5
11 Comments
 
LVL 61

Expert Comment

by:gheist
ID: 11688920
Please post output of:
uname -a
xterm -v
bash --version
tset -
to better sort out what your environment is and to provide exact solutions

bash uses readline library for all input handling, so please read "man readline" manual page to adjust key mappings
0
 
LVL 2

Author Comment

by:mikygee
ID: 11689317
$ uname -a
OpenBSD laptop.noos.fr 3.5 GENERIC#34 i386

$ bash --version
bash --version
GNU bash, version 2.05b.0(1)-release (i386-unknown-openbsd3.5)
Copyright (C) 2002 Free Software Foundation, Inc.

$ tset -
tset -
xterm

xterm -v
Doesn't work

I have tried a couple of things after reading man realine but without any success.

I had already succeded in muting the bell but no success with keybinding
0
 
LVL 61

Expert Comment

by:gheist
ID: 11691296
Up to my understanding
\b: \d
\d: \b
0
 
LVL 2

Author Comment

by:mikygee
ID: 11695764
bind "\d":delete-char doesn't work, nor bind "\b":delete-char
bind DEL:delete-char works but it makes also backspace to do the same thing as DEL and I don't want that.
Can't find the good keybinding for the Insert key as well
0
 
LVL 61

Expert Comment

by:gheist
ID: 11701965
not bind x y
but ~/.inputrc file is for readline config
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 2

Author Comment

by:mikygee
ID: 11710622
I copied
\b: \d
\d: \b
in .inputrc and it didn't solve the problem
0
 
LVL 61

Accepted Solution

by:
gheist earned 50 total points
ID: 11714595
try ksh, it has syntax like other Korn Shells, like bash2, has autocomplete and history browsable with arrows etc.
since bash is not statically linked it will not work in single user mode etc (do not even dream of running bash as root-s shell)
0
 
LVL 2

Author Comment

by:mikygee
ID: 11718272
I tryed lots of combinations, but it doesn't make any difference between DEL et RUBOUT keys.
I use zsh for my root account and I think I will stick with that shell for my other users in the future.
There is one thing  I don't understand is why bash runs so well under linux and pissing me off under openbsd.
0
 
LVL 2

Author Comment

by:mikygee
ID: 11718324
Thanx for help
0
 
LVL 61

Expert Comment

by:gheist
ID: 11719845
I did as root chsh and set ksh instead of csh, works fine still, just pressed DEL, yes it does not work, but anyway editing is possible with backspace in either xterm from putty vt220 from vandyke securecrt or vt220/vt100 form default console
0
 
LVL 61

Expert Comment

by:gheist
ID: 11719978
file `which bash`
file `which csh`
file `which ksh`
for more information - i.e. - bash will need /usr mounted to work
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Let's say you need to move the data of a file system from one partition to another. This generally involves dismounting the file system, backing it up to tapes, and restoring it to a new partition. You may also copy the file system from one place to…
Installing FreeBSD… FreeBSD is a darling of an operating system. The stability and usability make it a clear choice for servers and desktops (for the cunning). Savvy?  The Ports collection makes available every popular FOSS application and packag…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

948 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now