Andrew T.
2023-10-13 00:32:33 UTC
Hi all,
I've been developing a curses gemini client in C. It works fine
linked with ncurses (-lncurses at link time), but I'm now trying to
switch to ncursesw for wide character/utf-8 support. I figured
there'd be some bugs for be to track down, but the first one has me
stumped.
With no other changes other than the library linking, when I start the
program, everything is cut off at the 20 column mark (on an 80
character screen). I've tried this on the linux console, Eterm, and
uxterm all with the same result. If I set the environment variable
COLUMNS=320 (4*80), I get the full screen, except some functions (like
box() ) now really think the window is 320 columns.
Am I missing something here?
I'm using ncurses 6.0 and gcc 6.3.0 from the Devuan Ascii distribution
(old, I know, but Ascii's been working fine for me), along with the panel
library for most (all) of my window areas. Could it be a bug is 6.0?
Searching online, I've make sure to call setlocale(LC_ALL, "") and set
my locale information correctly (and UTF-8 gemini pages do display
correctly with COLUMNS=320).
I'm using ncursesw5-config for CFLAGS and libraries in my Makefile.
I've included the following in each .c file:
#define _XOPEN_SOURCE 800 /* Also tried 600 and leaving out */
#define _XOPEN_SOURCE_EXTENDED 1
and many other attempted tweaks.
The basic flow of the program, curses-wise, is:
int main() {
setlocale(LC_ALL, ""); /* first call in main() */
initScreen();
/* Run */
}
void initScreen() {
initscr();
mainwin = stdscr; /* Redundant, I know */
getmaxyx(mainwin, my, mx);
/* Create panels/windows for page, statbar and input bar */
initHelp(); /* Init help window (hidden for now) */
initStatbar();
}
I'm at a loss as to what I'm missing. Any ideas where to look or what
I may be missing?
Thanks in advance,
--Andrew
I've been developing a curses gemini client in C. It works fine
linked with ncurses (-lncurses at link time), but I'm now trying to
switch to ncursesw for wide character/utf-8 support. I figured
there'd be some bugs for be to track down, but the first one has me
stumped.
With no other changes other than the library linking, when I start the
program, everything is cut off at the 20 column mark (on an 80
character screen). I've tried this on the linux console, Eterm, and
uxterm all with the same result. If I set the environment variable
COLUMNS=320 (4*80), I get the full screen, except some functions (like
box() ) now really think the window is 320 columns.
Am I missing something here?
I'm using ncurses 6.0 and gcc 6.3.0 from the Devuan Ascii distribution
(old, I know, but Ascii's been working fine for me), along with the panel
library for most (all) of my window areas. Could it be a bug is 6.0?
Searching online, I've make sure to call setlocale(LC_ALL, "") and set
my locale information correctly (and UTF-8 gemini pages do display
correctly with COLUMNS=320).
I'm using ncursesw5-config for CFLAGS and libraries in my Makefile.
I've included the following in each .c file:
#define _XOPEN_SOURCE 800 /* Also tried 600 and leaving out */
#define _XOPEN_SOURCE_EXTENDED 1
and many other attempted tweaks.
The basic flow of the program, curses-wise, is:
int main() {
setlocale(LC_ALL, ""); /* first call in main() */
initScreen();
/* Run */
}
void initScreen() {
initscr();
mainwin = stdscr; /* Redundant, I know */
getmaxyx(mainwin, my, mx);
/* Create panels/windows for page, statbar and input bar */
initHelp(); /* Init help window (hidden for now) */
initStatbar();
}
I'm at a loss as to what I'm missing. Any ideas where to look or what
I may be missing?
Thanks in advance,
--Andrew
--
Andrew Turnquist, Short Tract, New York, USA (USDA Zone 5)
... wandering the streets of Usenet ...
(Remove numbers and .invalid for email address)
"Do what you can with what you have where you are." -T Roosevelt
Andrew Turnquist, Short Tract, New York, USA (USDA Zone 5)
... wandering the streets of Usenet ...
(Remove numbers and .invalid for email address)
"Do what you can with what you have where you are." -T Roosevelt