Comments (7)
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.
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.
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.
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:
Is this supposed to look like this?
from pdcurses.
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.
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.
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:
Btw, when using cmd.exe
the colors are correct. The pink issue is only with PowerShell.
from pdcurses.
Related Issues (20)
- Enabling support for showing window after process put to sleep (SDL2) HOT 4
- SDL_GetError() returns "Parameter 'src' is invalid" after call to initscr() for sdl2 HOT 2
- ncurses compat: add WACS_D_LRCORNER and other double line drawings
- SDL2 port missing support for PDC_PRESERVE_SCREEN HOT 4
- WinCon, endwin() kills QuickEdit/InsertMode options and more.. HOT 8
- touchoverlap() un-touches parts of lines HOT 1
- addition of vt port from Bill-Gray HOT 1
- additional gitpod config
- No rule to make target '../common/libobjs.mif'. Stop. HOT 5
- Unable to get mouse position when hovering HOT 9
- SDL2 build fails for Mac/Linux in Github HOT 2
- When resizing the SDL2 window, the surface isn't refreshed
- Build failure when building PDcurses DLL library for Window console HOT 1
- Debugging? HOT 1
- printw.c - for Unicode? HOT 3
- wresize doesn't return ERR if the window size requested is too big HOT 3
- Unable to initialize soft label keys HOT 2
- missing escapes in configure script HOT 1
- Scrolling and inserting/deleting lines
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pdcurses.