Backspace does not work when editing quick events

Bug #1117083 reported by Lars
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
wyrd
New
Undecided
Unassigned

Bug Description

With wyrd-1.4.5 typing <backspace> caused wyrd to segfault, this is improved in 1.4.6.

Actual result:
wyrd 1.4.6 completely ignores <backspace>.

Expected result:
When typing <backspace> the previous character is deleted and the cursor is moved to the previous character's place.

Steps to reproduce:
1) Type <q> to enter quick event editing
2) Type something
3) Try to delete the last character using backspace

Revision history for this message
Paul Pelzl (pelzlpj) wrote :

I guess not crashing is progress, at least.

It would help if you could capture a syscall trace, so I can see what code your terminal is sending when you hit the backspace key. Please do the following:

    1) Start wyrd using "strace wyrd 2> strace.txt"
    2) Hit 'q' to start quick reminder entry
    3) Type "XYZ<backspace><enter>"
    4) Hit Q to exit wyrd
    5) Attach a copy of strace.txt.

Thanks.

Revision history for this message
Lars (schallundrauch) wrote :
Revision history for this message
Paul Pelzl (pelzlpj) wrote : Re: [Bug 1117083] Re: Backspace does not work when editing quick events

Hmmm... looks just like mine. When you hit backspace your terminal is
writing 0x7f, but in your environment ncurses doesn't recognize 0x7f as
backspace.

What OS? What terminal emulator?

Paul

On Thu, Feb 7, 2013 at 3:15 AM, Lars <email address hidden> wrote:

> ** Attachment added: "strace wyrd 2> strace.txt"
>
> https://bugs.launchpad.net/wyrd/+bug/1117083/+attachment/3518483/+files/strace.txt
>
> --
> You received this bug notification because you are subscribed to wyrd.
> Matching subscriptions: wyrd
> https://bugs.launchpad.net/bugs/1117083
>
> Title:
> Backspace does not work when editing quick events
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/wyrd/+bug/1117083/+subscriptions
>

Revision history for this message
Lars (schallundrauch) wrote :

Sorry for the delay. I first wanted to track down this problem.

I found this Linux Backspace/Delete mini-HOWTO:
http://tldp.org/HOWTO/BackspaceDelete/index.html

On my system backspace in wyrd does not work in Konsole (my main terminal emulator), but in TTY and xterm. According to this comment in a corresponding Red Hat Bug (https://bugzilla.redhat.com/show_bug.cgi?id=142659#c4) Konsole is a deviant terminal emulator (as defined in http://tldp.org/HOWTO/BackspaceDelete/notwork.html) like gnome-terminal.

Here is an overview of my systems backspace and del key settings:

Backspace (kbs)

keycode: 22 (14)
keysym: 0xff08
ASCII sequence:
 - TTY: ^?
 - xterm: ^H
 - konsole: ^?
key capability (infocmp):
 - linux: ^?
 - xterm: ^H
 - gnome: ^?
stty -a (erase): ^?

Delete (kdch1)

keycode: 119 (111)
keysym: 0xffff
ASCII sequence:
 - TTY: ^[[3~
 - xterm: ^[[3~
 - konsole: ^[[3~
key capability (infocmp):
 - linux: \E[3~
 - xterm: \E[3~
 - gnome: \E[3~

As you can see the asccii sequences are the same for TTY and Konsole. So why is Konsole broken and not TTY? Because in TTY TERM is set to linux whereas in Konsole TERM is set to XTERM by default. According to the aforementioned bug report (https://bugzilla.redhat.com/show_bug.cgi?id=142659), Red Hat chose to follow the Debian policy (http://www.debian.org/doc/debian-policy/ch-opersys.html#s9.8). I.e. patching ncurses(terminfo)'s xterm alias so that kbs=\177 and patching xterm so that it sends \177 for backspace instead of ^H. I cannot see the rational behind this decision, rather it seems to me like the Red Hat devs were talking at crossed purposes. As I am a Gentoo Linux user I am free to follow my own policies and so I will set TERM to gnome in Konsole. This can be done via

Konsole Settings -> Edit Current Profile... -> Environment (Edit):
TERM=gnome

A few short tests showed that it fixes the backspace problem in wyrd without breaking backspace in other terminal apps (vim, mutt, mc, less). If I observe that this breaks something, I will report here.

I had no backspace-problems in Konsole with other terminal apps (vim, mutt, mc,...). I guess those apps do not use the terminal database. Wyrd seems to behave like ne (nice editor): "ne uses all terminal capabilities, including kbs and kdch1, and uses intended meaning only as a last resource." (http://tldp.org/HOWTO/BackspaceDelete/notwork.html)

Congratulations - wyrd works!

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.