This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: rxvt and line-drawing characters

Charles Wilson wrote:
Charles Wilson wrote:
Strangely, if I set TERM=rxvt-cygwin-native , use luconP as my font , it does NOT matter whether my CYGWIN variable has codepage:oem, codepage:ansi, or neither. The following behaviors are the same:

ascii.exe prints the line draw characters
pstree -G prints garbage

It *could be* due to the fact that pstree uses ncurses, and ascii does not. Checking...

Hmmm. /usr/lib/ncurses/test/ncurses.exe (part of the ncurses-demo package) turns the screen black-on-black when I try to check the line-draw characters. So I can't even tell if ACS chars with ncurses is broken -- first I gotta figure out why the colors are getting scrogged by the test program! Somebody, like the ncurses maintainer, should fix that.

Oh. That'd be me, then. Ooops. I'll try to look into it soon, but PTC.

Okay, so I've looked into this.
Thanks for looking into this...

(1) the ncurses "problem" is not a problem. The ncurses.exe test program leaves the decision as to whether to use colorfgbg() defaults up to the user (-a fg,bg to explicitly specify defaults, -d to inherit defaults from rxvt, or '' to use the DEFAULT defaults. Which is, apparently, black on black -- at least when run in an rxvt shell.)

So, running ncurses.exe with -d, (or, for that matter, the hideous -a 1,4 == red-on-blue, unless you've redefined rxvt's colors) works fine. With

rxvt -fn 'Lucida ConsoleP-16' -tn rxvt-cygwin-native -e /bin/bash

I get nice line draw characters from the ncurses.exe test program. With

rxvt -fn 'Lucida Console-16' -tn rxvt-cygwin-native -e /bin/bash

I get "european" characters where the line drawing ones used to be. Just as expected. Also, codepage:oem|ansi has no effect -- it only applies when using the windows console, not when using rxvt.

(2) So why does pstree misbehave? Because it's hardcoded to use VT-100 control characters for line drawing. But that's EXACTLY where rxvt differs from VT-100 (and where rxvt-cygwin differs from rxvt, and where rxvt-cygwin-native differs from them all).

pstree SHOULD be using tgetent() calls to dynamically obtain the appropriate line-drawing character codes and escape sequences from ncurses/terminfo. But it doesn't.

(There's also a similar bug in that it doesn't always calculate accurately the width of strings in which these line-draw chars are embedded...but that's a whole 'nother thing.)

Basically, pstree -G should be rewritten; it's just not going to work on cygwin's rxvt (native or X) very well.

"It's surely evil code"

Basically, you're stuck with 'pstree -A'.
Works in Cygwin but not on my Linux box (Fedora Core 3):

Jupiter:pstree -A
pstree: invalid option -- A
usage: pstree [ -a ] [ -c ] [ -h | -H pid ] [ -l ] [ -n ] [ -p ] [ -u ]
             [ -G | -U ] [ pid | user]
      pstree -V

   -a     show command line arguments
   -c     don't compact identical subtrees
   -h     highlight current process and its ancestors
   -H pid highlight process "pid" and its ancestors
   -G     use VT100 line drawing characters
   -l     don't truncate long lines
   -n     sort output by PID
   -p     show PIDs; implies -c
   -u     show uid transitions
   -U     use UTF-8 (Unicode)) line drawing characters
   -V     display version information
   -Z     show SELinux security contexts
   pid    start at pid, default 1 (init))
   user   show only trees rooted at processes of that user

A waist is a terrible thing to mind.

-- Unsubscribe info: Problem reports: Documentation: FAQ:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]