Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 18 Sep 2008 18:43:31 -0500 (CDT)
From:      Lars Eighner <luvbeastie@larseighner.com>
To:        manish jain <goodredhat@yahoo.com>
Cc:        freebsd <freebsd-questions@freebsd.org>
Subject:   Re: Problems on the console
Message-ID:  <20080918172333.A19245@qroenaqrq.6qbyyneqvnyhc.pbz>
In-Reply-To: <710047.2756.qm@web51305.mail.re2.yahoo.com>
References:  <710047.2756.qm@web51305.mail.re2.yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--0-1070322530-1221781411=:19245
Content-Type: TEXT/PLAIN; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: QUOTED-PRINTABLE

On Thu, 18 Sep 2008, manish jain wrote:

> Hi, =A0 I am using FreeBSD 6.2 without X/Xorg. My shell is bash and my
> keyboard layout is US-ISO. =A0 I am facing 2 problems on the console : =
=A0


> 1) My backspace key works fine, but the Del and Delete keys also do a
> backspace instead of a forward delete. How do I change this ? My
> keyboard=A0is a basic 101/102 keyboard.

This is the unix way.  There are two strings which may be mapped
to the keyboard Delete and Del (keypad . without num lock).

In the default us.iso keymap the Del key (scan 083) is mapped to del, which
is Ctrl-?  The Delete (scan 103) is mapped to fkey61 --- this is also
the string Ctrl-? --- not ^[[E which is the usual string for DOS type
keyboards.  As it happens ^[[E is fkey 54 which is keypad 5 without
num lock.

^? is not the same as backspace (^H), but it seems to be the case that
bash does the same thing with them.

From=20what is below I cannot tell what TERM you are using or what keys you
are trying to map to which function.  If you are really using the console o=
r
a virtual TTY, the inputrc below is completely screwy.

Mapping ^? to delete-char should get bash to do what you want.  However,
you can expect to have to make some adjustment to nearly every application,
because looks like backspace sort-of is the unix way.  Many applications
do recognize the difference between backspace (^H) and (^?) but do a
backwards delete (not the same as backspace) for ^?.

Generally, since I can become root, I map Delete to fkey54 in
syscons/keymaps/whateverkeymapyouuse.  If you tweak the keymap yourself,
besure to backup up your changes or change the keymap name to something not
otherwise being used because the default keymaps will be reinstalled
everytime you upgrade the system.  Then I map ^[[E to forward-delete
in applications, leaving Del as ^? in case this really does something
desirable in the application.

> 2) Bash simply does not remember
> my commands in the right order. Most of the commands I type in a login
> session are forgotten in the next session. Moving the Up and Down arrow
> keys navigates a mangled and incomplete command history. =A0 I am attachi=
ng
> the contents of my .bash_profile, .bashrc and .inputrc below.
>
> =A0
> #.bash_profile :
> if [ -f ~/.bashrc ]; then
> =A0source ~/.bashrc
> fi
> #end-of-file
>
> =A0
> #.bashrc :
> export HISTFILE=3D"~/.bash_history"

This is the default


> export HISTFILESIZE=3D1000
> shopt -s cmdhist
> shopt -s histappend
> #end-of-file
>
> =A0
> #.inputrc :
> "\e[1~": beginning-of-line
> "\e[4~": end-of-line
> "\e[3~": delete-char=A0#should be a forward delete unless I am mistaken
> "\eOd": backward-word=A0#ctrl-leftarrow
> "\eOc": forward-word=A0#ctrl-rightarrow

On a pc with an at keyboard with one of the default FBSD TERMs, none of
these strings are sent.


> set completion-query-items 20
> set meta-flag on
> set input-meta on
> set convert-meta off
> set output-meta on
> #end-of-file
>
> =A0
> If anyone can help me out, I shall be really grateful.
> =A0
> Thanks in advance,
> Manish Jain
> goodredhat@yahoo.com
>


       Unlimited freedom, unlimited storage. Get it now, on http://help.yah=
oo.com/l/in/yahoo/mail/yahoomail/tools/tools-08.html/
> _______________________________________________
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.o=
rg"
>
>

--=20
Lars Eighner
http://www.larseighner.com/index.html
8800 N IH35 APT 1191 AUSTIN TX 78753-5266
--0-1070322530-1221781411=:19245--




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080918172333.A19245>