Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 30 Dec 2015 06:05:29 +0100
From:      Polytropon <freebsd@edvax.de>
To:        "William A. Mahaffey III" <wam@hiwaay.net>
Cc:        FreeBSD Questions <freebsd-questions@freebsd.org>
Subject:   Re: delete button in console
Message-ID:  <20151230060529.67a4c714.freebsd@edvax.de>
In-Reply-To: <5682F182.7080603@hiwaay.net>
References:  <56825701.30908@gmail.com> <20151229180750.187ed7c9.freebsd@edvax.de> <5682F182.7080603@hiwaay.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 29 Dec 2015 14:53:32 -0553.75, William A. Mahaffey III wrote:
> On 12/29/15 11:14, Polytropon wrote:
> > On Tue, 29 Dec 2015 01:48:49 -0800, Sergei G wrote:
> >> When I ssh to a FreeBSD machine and press 'Delete' button in csh prompt
> >> I get character '~' printed on screen.  Backspace works just fine.
> >>
> >> I think even an actual console behaves the same way.
> >>
> >> Is there a way to "map" the Delete button to work appropriately? Would
> >> it be my SSH client application or FreeBSD itself?
> > This is a thing that can be configured for the shell. I assume
> > you're using FreeBSD's default dialog shell, the C shell. In
> > this case, add to ~/.cshrc:
> >
> > 	bindkey ^? delete-char		# for console
> > 	bindkey ^[[3~ delete-char	# for xterm
> >
> > Or to /etc/csh.cshrc, if you want to make it a global setting.
> >
> > You can check the success with the "stty -a" command.
> 
> 
> Is this keyboard dependent ? My keyboard apparently sends '^?' for its 
> backspace key.

No, this is a matter of terminal emulation. The keyboard usually
sends the same position code (or ASCII code) everywhere in the
world. If I remember correctly, Backspace is 0x08, and Delete is
something else.



> When I try the above, then 'stty -a', I see no setting.
> 
> 
> [wam@devbox, pre, 2:48:10pm] 2029 % bindkey '^?' delete-char
> 
>      .
>      .
>      .
> 
>      <try 'vi' on an ASCII file, BS key still doesn't work> ....
> 
>      .
>      .
>      .
> 

That may be a vi thing - I've tried it here, and backspace does
not do what it usually does in vi (neither in "insert" or "vi" mode).
At the regular console prompt, it works as intended (and in all
other text mode editors, like ee, too).



> I am actually using rxvt, logged into another box, but it apparently 
> advertises as xterm ....

Is the .cshrc setting being made on _that_ box (the target box)?
If the rxvt is configured "xterm-compatible", make sure you also
have the xterm setting. Compare:

	bindkey ^? delete-char		# for console
	bindkey ^[[3~ delete-char	# for xterm

It's helpful to define both.



-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...



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