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

Re: OS X Terminal.app and Aptitude



Ian Brandt <ian@ianbrandt.com> wrote:
> Sorry, meant for this to go to the list (why no Reply-To?)...

tin doesn't post to email (I often followup with the same information)

> Thomas Dickey wrote:

> First off thank you for such a helpful response!

>>> "pretty garbled" could be more than one thing...

> Here are some screen shots:

> <http://www.flickr.com/photos/44533716@N00/sets/72157594195837848/>

>>> Backing up a little, I'd edit that line to show
>>>
>>> macosx|generic color xterm,
>>>
>>> and remove the $HOME/.terminfo/x/xterm-color and
>>> $HOME/.terminfo/n/nxterm,
>>> rerun tic.  Then
>>>
>>> 	infocmp macosx xterm-color
>>>
>>> would show whatever changes were made other than the sgr string.

> Here is the result:

> $ infocmp macosx xterm-color
> comparing macosx to xterm-color.
>     comparing booleans.
>     comparing numbers.
>     comparing strings.
>         hts: '\EH', NULL.
>         is2: '\E7\E[r\E[m\E[?7h\E[?1;3;4;6l\E[4l\E8\E>',
>              '\E[m\E[?7h\E[4l\E>\E7\E[r\E[?1;3;4;6l\E8'.
>         kdch1: '\E[3~', '\177'.
>         kend: NULL, '\E[4~'.
>         kfnd: '\E[1~', NULL.
>         khome: NULL, '\E[1~'.
>         kslt: '\E[4~', NULL.
>         meml: NULL, '\El'.
>         memu: NULL, '\Em'.
>         rs2: '\E7\E[r\E8\E[m\E[?7h\E[?1;3;4;6l\E[4l\E>',
>              '\E[m\E[?7h\E[4l\E>\E7\E[r\E[?1;3;4;6l\E8'.

ok.  Much of this is benign.  Note that is2 and rs2 are for instance just
altered order.  The macosx flavor is older.  khome/kend and kfnd/kslt are
again an older choice (modeled on vt220) versus the newer preference.

kdch1 is like backspace/delete one of the troublesome things, since it's
not the "backspace" key but the "Delete" key on the small editing keypad.
screen will do odd things if it has the same string as kbs.

>>> xterm-color is almost certainly technically incorrect because it's
>>> unlikely that Terminal was designed to match that set of data.

> I agree.

>>> Running on Debian, you should be able to use tack (part of ncurses)
>>> to step through the features.  I'd expect some differences on the
>>> color model for instance.  Seeing the test fail for either flavor
>>> of "xterm-color" should help a little.

> I'll try to learn my way around tack's tests and follow up with a
> meaningful log.

>>> Since xterm-color was not designed to match Terminal, any
>>> differences here aren't going to be applied to ncurses.  (In
>>> articular, I recall some complaints that the backspace/delete
>>> settings don't match Debian).  But it would be useful to have an
>>> accurate terminal description for Terminal.
>>>
>>> Supposedly we already have this - the nsterm entries that have
>>> been in ncurses since 2001.  There were some minor fixes to those
>>> early this year - see
>>>
>>> 	ftp://invisible-island.net/ncurses/terminfo.src.gz

> I compiled your terminfo on my Debian box, and ssh'd over with TERM
> set to 'nsterm'.  A few initial observations:

>   - Color is lost at the Bash prompt.

bash on Debian?  odd - since I thought it would be using ncurses (actually
the termcap interface).  It may be special-casing $TERM by comparing for
something containing "xterm".

>   - Horizontal borders in Aptitude (e.g. in the search or quit
> dialogs) become '?' characters.

This is more interesting.  Those dashes look like they're double-width.  I have
a hunch that your locale on Debian is set to a UTF-8 flavor and that aptitude
is emitting line-drawing in UTF-8, but that Terminal isn't doing the Right
Thing with that.  A quick check with uxterm shows me that aptitude sends
_something_ in UTF-8.

I seem to recall reading that Terminal can handle UTF-8, so given that, one of
these possibilities comes to mind:

	a) the OS X locale isn't UTF-8 (and Terminal gets confused)

	b) Terminal works for UTF-8 text, but not line-drawing (chooses
	   an incorrect set of glyphs for mapping the line-drawing text).

>   - Delete works at the bash prompt, but in Aptitude it prints '^[[3~'.
>   - Backspace works in Aptitude, whereas with xterm-color it printed '^?'.


Your stty settings might not match the nsterm terminfo entry.  Bear in
mind that for *BSD the general rule is

	stty erase \^H

while Debian does

	stty erase \^?

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net



Reply to: