xaizek / vifm-pdcurses (License: mostly public domain) (since 2019-03-20)
PDCurses 3.4 with vifm-specific patches applied (a couple were upstreamed)
Commit df1c9967ec3f68f2a6e866dc41ec4d92c78747d1

Proper color reversing on Windows
I noticed strange behaviour of A_REVERSE attribute on Windows, which
lost A_BOLD attribute of colors. The issue is that while colors are
reversed, corresponding flags that define which (foreground and/or
background) color is bold are left intact.

This patch has been taken from:
https://sourceforge.net/p/pdcurses/discussion/95730/thread/395ac4ed/
Author: xaizek
Author date (UTC): 2024-12-19 16:01
Committer name: xaizek
Committer date (UTC): 2024-12-19 16:03
Parent(s): 18c6c5dfb9ddcb7c55dce93d9ab05db3970463e3
Signing key: 99DC5E4DB05F6BE2
Tree: 8fe3cbba1c60dd8d5407e724def9bcdeb1ecef58
File Lines added Lines deleted
win32/pdcscrn.c 5 3
File win32/pdcscrn.c changed (mode: 100644) (index da84cdeb..4d9ce510)
... ... void PDC_init_pair(short pair, short fg, short bg)
555 555
556 556 for (i = 0; i < PDC_OFFSET; i++) for (i = 0; i < PDC_OFFSET; i++)
557 557 { {
558 const int reverse = (i & (A_REVERSE >> PDC_ATTR_SHIFT));
559
558 560 att = fg | (bg << 4); att = fg | (bg << 4);
559 561
560 if (i & (A_REVERSE >> PDC_ATTR_SHIFT))
562 if (reverse)
561 563 att = bg | (fg << 4); att = bg | (fg << 4);
562 564 if (i & (A_UNDERLINE >> PDC_ATTR_SHIFT)) if (i & (A_UNDERLINE >> PDC_ATTR_SHIFT))
563 565 /* No underscores in Windows terminals. */ /* No underscores in Windows terminals. */
 
... ... void PDC_init_pair(short pair, short fg, short bg)
568 570 att = temp_bg << 4 | temp_bg; att = temp_bg << 4 | temp_bg;
569 571 } }
570 572 if (i & (A_BOLD >> PDC_ATTR_SHIFT)) if (i & (A_BOLD >> PDC_ATTR_SHIFT))
571 att |= 8;
573 att |= reverse ? 128 : 8;
572 574 if (i & (A_BLINK >> PDC_ATTR_SHIFT)) if (i & (A_BLINK >> PDC_ATTR_SHIFT))
573 att |= 128;
575 att |= reverse ? 8 : 128;
574 576
575 577 pdc_atrtab[pair * PDC_OFFSET + i] = att; pdc_atrtab[pair * PDC_OFFSET + i] = att;
576 578 } }
Hints

Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://code.reversed.top/user/xaizek/vifm-pdcurses

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/vifm-pdcurses

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a pull request:
... clone the repository ...
... make some changes and some commits ...
git push origin master