help-zile
[Top][All Lists]
Advanced

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

[zile-devel] [ zile-Patches-1563161 ] FIx c-h on OS X


From: SourceForge.net
Subject: [zile-devel] [ zile-Patches-1563161 ] FIx c-h on OS X
Date: Fri, 16 Mar 2007 16:16:58 -0700

Patches item #1563161, was opened at 2006-09-21 22:08
Message generated for change (Comment added) made by rrt
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=317089&aid=1563161&group_id=17089

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Michael Stevens (mpstevens_uk)
Assigned to: Nobody/Anonymous (nobody)
Summary: FIx c-h on OS X

Initial Comment:
I'm not sure if this is portable, but...

I've been trying to install zile on OS X.

The 2.2.22 release can't tell the difference between ^h and backspace - 
both are treated as backspace.

The patch below fixes things in Terminal.app on OS X, but I haven't tested 
elsewhere.

----------------------------------------------------------------------

>Comment By: Reuben Thomas (rrt)
Date: 2007-03-16 23:16

Message:
Logged In: YES 
user_id=50145
Originator: NO

File Added: xterm

----------------------------------------------------------------------

Comment By: Reuben Thomas (rrt)
Date: 2007-03-16 23:16

Message:
Logged In: YES 
user_id=50145
Originator: NO

Your settings and the curses.h header file all look fine. From the patch
and what you've told me so far, zile is getting KEY_BACKSPACE when you
press Control-H, and presumably is getting 0177 when you press Backspace.
The latter is fine, the former is not. The odd thing is that according to
stty you don't have erase set to ^H, so why curses gets KEY_BACKSPACE when
you press Control-H is a mystery.

OK, here:

http://log.antiflux.org/grant/2004/03/29/backspace-delete

I found the following explanation:

"stty has erase = ^?, the default. That’s ASCII DEL (127 or \177), and
it should (ha!) work as backspace everywhere. The terminfo entry for
xterm-color (and all the other terminals that Terminal.app emulates)
reports the kbs (backspace) capability as ^H."

In other words, terminfo is messed up. What does "infocmp $TERM |grep kbs"
say for you? For me it says "kbs=\177" in the relevant part of the line.
I'm guessing that for you it says "kbs=^H" or similar.

There's a solution on this page, elaborated at:

http://community.livejournal.com/evan_tech/64392.html

I have attached the mentioned Debian file. If this lot helps you out, I'll
add a FAQ. Just to make it clear, as far as I can tell, the problem is that
stty's default erase setting doesn't match terminfo's kbs for your
terminal.

----------------------------------------------------------------------

Comment By: Michael Stevens (mpstevens_uk)
Date: 2007-03-11 20:28

Message:
Logged In: YES 
user_id=794684
Originator: YES

Looking in curses.h I see:

#define KEY_BACKSPACE   0407            /* backspace key */

Looking in the Terminal config I don't have any special binding for
backspace.

stty -a says:
> stty -a
speed 9600 baud; 30 rows; 84 columns;
lflags: icanon isig iexten echo echoe -echok echoke -echonl echoctl
        -echoprt -altwerase -noflsh -tostop -flusho pendin -nokerninfo
        -extproc
iflags: -istrip icrnl -inlcr -igncr ixon -ixoff ixany imaxbel -ignbrk
        brkint -inpck -ignpar -parmrk
oflags: opost onlcr -oxtabs -onocr -onlret
cflags: cread cs8 -parenb -parodd hupcl -clocal -cstopb -crtscts -dsrflow
        -dtrflow -mdmbuf
cchars: discard = ^O; dsusp = ^Y; eof = ^D; eol = <undef>;
        eol2 = <undef>; erase = ^?; intr = ^C; kill = ^U; lnext = ^V;
        min = 1; quit = ^\; reprint = ^R; start = ^Q; status = ^T;
        stop = ^S; susp = ^Z; time = 0; werase = ^W;


----------------------------------------------------------------------

Comment By: Reuben Thomas (rrt)
Date: 2007-02-12 00:27

Message:
Logged In: YES 
user_id=50145
Originator: NO

This isn't a bug in Zile, it's a question of how Terminal is set up (and
possibly curses.h). Can you find out for me how KEY_BACKSPACE is defined in
curses.h. Your patch messes things up because KEY_BACKSPACE should do
"backspace", not "Ctrl-H". I believe that you can ensure that Terminal
sends Ctrl+? when you press Backspace, rather than Ctrl-H, which is
possibly what is happening at present.

Sorry I took so long to read this; I've taken steps to ensure I don't
overlook patches in future.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=317089&aid=1563161&group_id=17089



reply via email to

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