Git Product home page Git Product logo

Comments (7)

wmcbrine avatar wmcbrine commented on June 3, 2024

PowerShell is just a command shell; it doesn't affect PDCurses' interaction with the display, versus the old CMD.EXE. Where you will see a difference is with the classic Windows Console vs. the newer Windows Terminal. PDCurses supports both, but their capabilities are slightly different -- for example, A_ITALIC only works in Windows Terminal.

Anyway, no, what you describe isn't normal. If I had to guess, you might be including a different curses.h (say, from ncurses?) than the one the library you're linking was built with.

I'd ask you to explain the exact steps you're taking in building both the library and your app. Meanwhile, you could try building the demos (nmake -f Makefile.vc demos, assuming you're using Visual Studio), and see what testcurs.exe does. The "Attrib Test" should show the correct behaviors, to the extent they're supported by your terminal.

from pdcurses.

afalkenhahn avatar afalkenhahn commented on June 3, 2024

testcurs.exe works indeed so I examined what it did that my program didn't do. Apparently, A_BLINK and A_BOLD didn't work in my program because I didn't call PDC_set_blink(TRUE) and PDC_set_bold(TRUE). If I call those two functions A_BLINK and A_BOLD finally work but I'm a little puzzled why those functions are there in the first place. I thought PDCurses was meant to be a wrapper for (n)curses so that I could just recompile my curses code and it would work. The necessity to call custom functions like PDC_set_blink() and PDC_set_bold() to make A_BLINK and A_BOLD work somehow contradicts that concept IMHO so I'm not sure why it was designed like that but maybe there's a good reason.

Anyway, calling PDC_set_blink(TRUE) and PDC_set_bold(TRUE) solves the problem.

from pdcurses.

wmcbrine avatar wmcbrine commented on June 3, 2024

This is something that I kind of take for granted, since it developed over a long time. It probably should be better documented outside of just the comments in HISTORY. I started writing something up, but it's too long for a comment here. I could just say "yes, there's a good reason", but let me try to summarize...

Historically, the terminals that curses was originally written for had a very limited set of attributes, and that's even more true of PDCurses, which first targeted IBM PC clone video cards. It was only relatively recently that, say, the Windows Terminal allowed for both a full set of colors and true bold and blinking, at the same time. In the past, these attributes were instead used to control the "intensity" bits of the foreground and background, so that 16 colors could be used, even with only 8 explicitly defined "colors". You could see this with ncurses, too, depending on the terminal (e.g. the Linux console, back when it used regular text mode on PC hardware). So, PDCurses retains backwards compatibility with programs that expect this.

That still doesn't quite explain your "pink" or "yellow" (hence my confusion), unless you were already using the non-"intense" versions of those colors.

from pdcurses.

afalkenhahn avatar afalkenhahn commented on June 3, 2024

Thanks for the explanation!

That still doesn't quite explain your "pink" or "yellow" (hence my confusion), unless you were already using the non-"intense" versions of those colors.

If you want to see the pink background, just use this little demo program:

#include <curses.h>

int main(int argc, char *argv[])
{	
	initscr();	
//        PDC_set_blink(TRUE);			
	attron(A_BLINK);
	printw("Hello World!");	
	refresh();
	getch();
	endwin();

	return 0;
} 

If PDC_set_blink(TRUE) isn't called, A_BLINK will lead to this look in PowerShell, white text on a pink background:
shot2

Is this supposed to look like this?

from pdcurses.

wmcbrine avatar wmcbrine commented on June 3, 2024

I see a "light black" (dark grey) background, as expected, when I run it here. The same under all four combinations of shell and terminal, and I even have my Windows Terminal set to weird default colors. I dunno what to tell you.

from pdcurses.

wmcbrine avatar wmcbrine commented on June 3, 2024

Perhaps the palette (Windows Terminal calls them "Color schemes") you're using is wonky -- with pink in the spot that's usually light black.

from pdcurses.

afalkenhahn avatar afalkenhahn commented on June 3, 2024

Perhaps the palette (Windows Terminal calls them "Color schemes") you're using is wonky -- with pink in the spot that's usually light black.

Could be. I don't remember having changed anything in there but I can't say for sure. This is what the color page of PowerShell looks like here:
shot3

Btw, when using cmd.exe the colors are correct. The pink issue is only with PowerShell.

from pdcurses.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.