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: Tue, 03 Apr 2007 02:49:10 -0700

Patches item #1563161, was opened at 2006-09-21 22:08
Message generated for change (Comment added) made by mpstevens_uk
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: Closed
Resolution: Invalid
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: Michael Stevens (mpstevens_uk)
Date: 2007-04-03 10:49

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

I'll leave it I think. I've actually decided to stop using OS X because of
the poor unix side, and have only been keeping it around while this bug
gets sorted.

Thanks for your help.

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

Comment By: Reuben Thomas (rrt)
Date: 2007-03-24 22:56

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

I think the following is a sensible course of action:

1. Make a bug report to Apple. I know, this is likely to be tricky (at
least, to make it effective), but at least now you have a clear case to
make: terminfo and stty have conflicting defaults.

2. Improve your patch so that it only becomes effective if the conflicting
defaults are present. By doing this, you a) don't irritate users who have
made their own fix, e.g. because they have read the upstream FAQ (I have
now put a note about this in the FAQ), and b) won't have to remove the
patch when Apple does fix the bug, so that it can remain in your port for
as long as there are users running Mac OS with the bug, i.e. a long time.

If you did 2, I'd be happy to put it in a new release; it would also
benefit users of old UNIX-style systems with the same problem. Since Mac OS
X's UNIX internals have not had the same polish as, for example, most Linux
distributions, in a way it's just a bit behind the curve.

I'm closing the bug (since it isn't a bug in zile); if you wish to submit
a patch, please do so in the patch tracker.

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

Comment By: Michael Stevens (mpstevens_uk)
Date: 2007-03-24 19:21

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

address@hidden:~
> infocmp $TERM |grep kbs
        is2=\E[m\E[?7h\E[4l\E>\E7\E[r\E[?1;3;4;6l\E8, kbs=^H,

You're right.

Installing the xterm file in $HOME/.terminfo/78/xterm seems to have fixed
it.

I'm undecided what to do in the macports package (which *does* have my
patch applied).

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

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]