bug-zile
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-zile] C-h under GNU screen


From: Micah Cowan
Subject: Re: [Bug-zile] C-h under GNU screen
Date: Wed, 04 Jun 2008 16:51:13 -0700
User-agent: Thunderbird 2.0.0.14 (X11/20080421)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Reuben Thomas wrote:
> On Wed, 4 Jun 2008, Micah Cowan wrote:
> 
>> I suspect that the reason may well be related to the terminfo
>> settings I have for screen; "infocmp" gives the following output:
>> 
>> #       Reconstructed via infocmp from file: 
>> /usr/share/terminfo/s/screen screen|VT 100/ANSI X3.64 virtual
>> terminal, ... il=\E[%p1%dL, il1=\E[L, ind=^J, is2=\E)0, kbs=^H,
>> kcbt=\E[Z, ...
>> 
>> As you can see, it gives ^H for kbs. However, stty -a has erase=^?;
>> and GNU Emacs (as I mentioned) correctly distinguishes C-h from
>> backspace.
> 
> As you say, these settings are inconsistent. Zile doesn't use
> terminfo or stty directly; it uses ncurses. I've tried to get down
> and dirty with terminfo before but it only caused more problems than
> it solved, so I don't want to follow that route again.
> 
> I am however interested in eradicating the underlying bug here, if it
>  still exists, so that in future Zile users will be less likely to
> run into it.

In this case, fixing the problem would be less an issue of getting down
and dirty with terminfo, and more an issue with using the terminal's
termios structure's idea of what backspace is, rather than what
terminfo's idea is. Of course, detecting the difference would be the
hard part, since by default we'll always get ncurses' idea of what
backspace is.

My Ncurses documentation on getch(3X) and related functions, has this
paragraph:

> Note that some keys may be the same  as  commonly  used  control
> keys, e.g., KEY_ENTER versus control/M, KEY_BACKSPACE versus
> control/H.  Some curses implementations may differ according to
> whether they treat these control  keys  specially (and ignore the
> terminfo), or use the terminfo definitions.  Ncurses uses the
> terminfo definition.  If  it  says  that KEY_ENTER is control/M,
> getch will return KEY_ENTER when you press control/M.

In this case, it had maybe been nice if ncurses supplied a way to
control this behavior, but...

>> It may be that it's from an older screen setting, or perhaps it's 
>> distro-specific changes.
> 
> I'd be most grateful if you could shed any further light on this.

Looking at the history of src/terminfo/screeninfo.src, it appears that
^H (written as \b here) is from the original screen terminfo file, but
was removed in version 4.0.0. Probably for problems just like this one.

http://cvs.savannah.gnu.org/viewvc/screen/src/terminfo/screeninfo.src?root=screen&r1=1.13&r2=1.14

>> Be that as it may, the fact that there's a difference in behavior 
>> between Zile and Emacs, suggests to me that it's worth looking into
>> a workaround for this problem.
> 
> I fear that this way lies only pain, especially in trying to hack
> around ncurses. Suggestions welcome, as usual.

If I get a chance, I'll poke around in Emacs to see if I can find out
why its behavior is different, and whether a similar approach might make
sense in Zile (I can't promise I'll actually get around to this,
unfortunately).

- --
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer,
and GNU Wget Project Maintainer.
http://micah.cowan.name/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFIRypx7M8hyUobTrERAk3JAJ9ey+9nl13XzIS2OnyL/MDdsXwH8wCcCBjC
lTKEzbtrItGPlCbNZcGg08w=
=geVF
-----END PGP SIGNATURE-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]