[code] Re: backspace again + translated strings

From: Joshua Krämer <joshua.kraemer.att.gmail.com>
Date: Wed, 13 Aug 2014 14:10:05 +0200

On 2014-08-13, 11:35, Niklas W wrote:

> On Tue, 12 Aug 2014 08:33:52 -0400 (Eastern Daylight Time)
> Mitchell <m.att.foicica.com> wrote:
> > On Sun, 10 Aug 2014, Niklas W wrote:
> > > The keycode in keypress() becomes 0, not 127...
> >
> > I'm honestly not sure what the problem is. I would think if the
> > terminal is set up to emit 127 for backspace, then libtermkey (the
> > library that interprets keypresses) should recognize it. How did
> > you do the remapping? Perhaps I can try what you did and figure out
> > the problem.
> I tried every terminal emulator I have installed. All of them use 127
> by default, except maybe for xterm.

I use xterm, and it sends DEL = ASCII 127 (default configuration).
Ctrl-v backspace shows ^?, accordingly.

To check what code textadept receives, I have done the following, as
suggested in http://foicica.com/lists/code/201312/1454.html:

| uncomment line 250 in `core/keys.lua` and change it to read:
| if CURSES then ui.statusbar_text = code end

Strangely, both backspace and Ctrl-h are shown as "8", although xterm
sends ASCII 127. Moreover, in the mentioned thread, it was also
reported that backspace is shown as "" in putty, although it should
send ASCII 127, too.

Maybe there is a bug in libtermkey?

On 2014-08-10, 22:40, Niklas W wrote:

> 1) Backspace works if the terminal is set to generate Control-H.
> However, I'd like it to generate ASCII DEL (127), which seems to be
> standard and also has the advantage that you can use Ctrl-H for
> something else.

If you want to configure Ctrl-h to something else, I'd suggest to use
the CSI u encoding. Add this to your .Xresources:

*VT100.Translations: #override \n\
        Ctrl<Key>h: string("") \n

Now a unique code for Ctrl-h will be sent. With the CSI u encoding,
you can even encode combinations with more than one modifier
unambiguously. Yes, that means you can use Shift-Ctrl shortcuts in
the terminal! The encoding scheme is explained here:


On 2014-08-13, 11:35, Niklas W wrote:

> With xterm you can add to your ~/.Xdefaults:

By the way, regarding .Xdefaults, here is a quote from the Xsession (5)
man page in Debian:

| Note that $HOME/.Xdefaults is a relic from X Version 10 (and X11R1)
| days, before app-defaults files were implemented. It has been
| deprecated for over ten years at the time of this writing.
| .Xresources should be used instead.

Kind regards,

You are subscribed to code.att.foicica.com.
To change subscription settings, send an e-mail to code+help.att.foicica.com.
To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
Received on Wed 13 Aug 2014 - 08:10:05 EDT

This archive was generated by hypermail 2.2.0 : Thu 14 Aug 2014 - 06:42:17 EDT