Questions tagged [ncurses]

The ncurses package is a subroutine library for terminal-independent screen-painting and input-event handling.

The Ncurses (new curses) library is a free software emulation of curses portable to most terminal systems. It uses Terminfo format, supports pads, color, multiple highlights, forms, characters and function-key mapping, and has all the other SYSV-curses enhancements over BSD Curses.

See also: -

1850 questions
0
votes
1 answer

Why does getch() read EOF after calling halfdelay() with a very short delay?

I'm experminenting with ncurses and I've stumbled upon a bit counter-intuitive behaviour when usinghalfdelay with small delays. The following expects keyboard input from the user. Rather than just pressing and releasing a key, I'm testing it with…
banach-space
  • 1,781
  • 1
  • 12
  • 27
0
votes
1 answer

Ncurses ACS_BLOCK not the same as WACS_BLOCK?

I switched over from add_ch to having to use add_wch which caused me to also have to change using the various ACS_ special drawing characters to the WCS_ version. The problem I found is that the WCS_ version is not a FULL block, but only a partial…
user3161924
  • 1,849
  • 18
  • 33
0
votes
1 answer

Why PDcurses shows strings differently from source file and stream?

Here is my C code: int main(){ _setmode(_fileno(stdout), _O_U16TEXT); FILE* myFile = fopen("text.txt", "r"); wchar_t line[100]; fgetws(line,100,myFile); clear(); initscr(); addwstr(L"♠♣♥♦\n"); addwstr(line); refresh(); …
0
votes
1 answer

Keeping aspect ratio in C (ncurses)

I need to make a game using ncurses in C. The game needs to be 80(char)x24(char). I need an status bar on the bottom (5 char) so I hardcoded it. I made this loop to keep things centralized, but I can't figure out how to keep the aspect ratio when…
0
votes
0 answers

C Programming ncurses printw issue

I've recently by writing some programs in C using the ncurses library on an Arch Linux machine. I've of course been using printw to print text out to the screen (specifically stdscr). However, I've been having a weird issue when using printw. If…
jsmith
  • 151
  • 1
  • 8
0
votes
0 answers

assigning a window to another window in ncurses

Whenever I do this and print the window, the upper left corner is open. WINDOW* win1 = newwin(10, 10, 10, 10); WINDOW* win2 = newwin(10, 10, 10, 10); win1 = win2; box(win1, 0, 0); Is there any way to fix this?
Joe
  • 13
  • 2
0
votes
2 answers

NCurses getch always returns ERR (-1)

I've just started to work with ROS and I'm trying to write a node that publish keys in a topic. I have created a node on a Linux Ubuntu 16.04.4 using ncurses. This is my code: #include #include "ros/ros.h" #include…
VansFannel
  • 45,055
  • 107
  • 359
  • 626
0
votes
3 answers

Help needed in Segmentation Error in my C code

I have been trying to identify where my program generates segmentation all to no avail. I need help in pin-pointing which of the strings operations or char pointers is causing the segmentation fault during runtime. The program compiles successfully…
realsaid
  • 51
  • 4
0
votes
1 answer

Ncurses WINDOW not refreshing properly

i'm trying to increment and decrement values on an ncurses window using mouse clicks, everything is working fine, but if i decrement up till the point where the number is negative then try to increment again (like -1), the second character (the 1)…
0
votes
1 answer

suspend a thread in c

I'm writing a program in C where I need multithreading (pthread). The thread is created several times, let's say 5. I use ncurses (kind of graphical windows in the terminal) where I have added some buttons and I want to click on the button to…
kotasha
  • 45
  • 5
0
votes
1 answer

Color-Only Coloring Differs From Text+Color-Coloring

If I print a character using a chtype, the ncurses container object for characters, only specifying a color like COLOR_PAIR(SOME_PAIR), I get two characters of color. Using ' ' | COLOR_PAIR(SOME_PAIR), that is, OR-ing with a character, I get just…
cadaniluk
  • 15,027
  • 2
  • 39
  • 67
0
votes
1 answer

C program behaving differently on Mac OSX and Linux

I have written a program that creates a sidescrolling marquee effect, and it works perfectly on my Mac's terminal. However, when I run it on my raspberry pi (Raspbian Linux), the effect messes up and starts printing on a new line and doesn't scroll…
jmglynn
  • 31
  • 1
  • 4
0
votes
1 answer

Cannot get arrow keys to move cursor in curses (C)

Below is my code. I have a main window with two choices that I want the user to be able to key back and forth to just using KEY_LEFT and KEY_RIGHT. I have it set up in a simple manner right now (or so I thought) by just moving the cursor directly to…
DryHeeves
  • 3
  • 3
0
votes
0 answers

Ncurses "initscr()" causes segmentation fault

I am currently working on a project, where I have to implement a snake game which compiles just fine on itself with g++, the problem is when I try to integrate it into the greater project which compiles using CMake it throws a segmentation fault,…
0
votes
1 answer

top and bottom half block character in ncurses

I'm building a ncurses program in c and i want to get the upper and lower half block characters (U+2580 and U+2584 for example) (▀) for graphics on small terminals (i normally use double space and inverted double space). I've tried a lot of…
C32
  • 161
  • 8