Solved

bind keys  bash

Posted on 2004-08-01
11
526 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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
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…

760 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

18 Experts available now in Live!

Get 1:1 Help Now