On Fri, 18 Mar 2005, Charles Lepple wrote:

> on line 1254 of dstat (0.5.7-2):
> 
> ### Check terminal capabilities
> #    if not sys.stdout.isatty() or not curses.wrapper(lambda \ 
> #     s:curses.has_colors()):
>      if not sys.stdout.isatty() or os.environ.get('TERM',None) not in \
>         ('ansi', 'linux', 'rxvt', 'screen', 'screen-w', 'xterm'):
>                 op.color = False
>                 op.nolimit = True
>                 op.update = False
> 
> When using xterm-color, dstat reverts back to uncolored, continuous (no
> headers) format.

Ack. :(


> Also, I'm not exactly sure about the op.nolimit and op.update options,
> but it seems like those should be conditional on the "not
> sys.stdout.isatty()" test, and if stdout is a terminal, then op.color
> should be set. That way, even if I am on a non-color-capable terminal,
> the headers will get redisplayed once per screenful of stats.

This was actually for people who were piping the output to a file. In that 
case you don't want colors or any of the ansi/vt100 crap :) But there's a 
lot of potential improvements in this area.


> I realize that adding all color-capable terminals to the list would be a
> big maintenance headache, but it would be nice if any terminal ending in
> "-color" turned on op.color. Or, there could be a --color option to
> complement --nocolor.

I'd love to use ncurses for what it was designed, sadly if I try to use 
ncurses it clears the complete screen or does something ugly inside a 
screen.

Any help in this regard is welcome. I know my current implementation is 
probably only useful to 90% of the users. I already had problem reports 
on older (debian stable) rxvt and recently eterm, using ncurses would be a 
good help. I worked around the rxvt and still have to try out eterm.

Anyone with python and ncurses skills around ? :)

BTW thanks for your feedback !
--   dag wieers,  [EMAIL PROTECTED],  http://dag.wieers.com/   --
[all I want is a warm bed and a kind word and unlimited power]


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to