Solved

bind keys  bash

Posted on 2004-08-01
11
545 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 5
11 Comments
 
LVL 62

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 62

Expert Comment

by:gheist
ID: 11691296
Up to my understanding
\b: \d
\d: \b
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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 62

Expert Comment

by:gheist
ID: 11701965
not bind x y
but ~/.inputrc file is for readline config
0
 
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 62

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 62

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 62

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
My previous tech tip, Installing the Solaris OS From the Flash Archive On a Tape (http://www.experts-exchange.com/articles/OS/Unix/Solaris/Installing-the-Solaris-OS-From-the-Flash-Archive-on-a-Tape.html), discussed installing the Solaris Operating S…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

734 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