On Thu, Jan 01, 2026 at 08:43:45AM +0200, Giorgos Xou wrote:
> Apparently it seems like ncurses for some reason is not setting the dim
> attribute for kitty-terminal:
> https://github.com/kovidgoyal/kitty/issues/446#issuecomment-3702379671

I don't see that.

A comment

        https://github.com/kovidgoyal/kitty/issues/446#issuecomment-3702419540

gives an example

        kitty --dump-commands python -c 'import curses; curses.wrapper(lambda 
stdscr: (stdscr.addstr(0,0,"Dim Text",curses.A_DIM), stdscr.addstr(1,1, "Normal 
Text", 0), stdscr.getch()))'

which can be run as a separate script, to capture the output from
ncurses, e.g,.

        TERM=kitty script -c "python example.py"

with this in "example.py":

import curses
curses.wrapper(lambda stdscr:
  (stdscr.addstr(0,0,"Dim Text", curses.A_DIM),
   stdscr.addstr(1,1, "Normal Text", 0),
   stdscr.getch()))

and then converted for readability

        https://invisible-island.net/misc_tools/index.html#item:unmap

which gives this (after clearing the screen):

\E[?7l 
\E[?7h
\E[H
\E(B
\E[0;2m
\E[39;49m
\E[37m
\E[40mDim Text
\E[2;2H
\E(B
\E[m
\E[39;49m
\E[37m
\E[40mNormal Text
\E[?1l
\E[39;49m\r
\E[40d
\E[K
\E[40;1H
\E[?1049l\r
\E[?1l

The dim text is done with this chunk, which first resets SGR (0), then
turns on dim (2), resets colors (39/49) then sets them (37/40).

\E[0;2m
\E[39;49m
\E[37m
\E[40mDim Text

So ncurses is doing what it's supposed to (with a minor quibble regarding
the unnecessary 39/49 which is overridden by the 37/40: ncurses doesn't
look into op=\E[39;49m to see that it overlaps with setaf and setab).

-- 
Thomas E. Dickey <[email protected]>
https://invisible-island.net

Attachment: signature.asc
Description: PGP signature

Reply via email to