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

How to process KEY_HOME and KEY_END reliably under ncurses

I am struggling to have ncurses generate KEY_HOME or KEY_END events, instead the raw escape sequence is coming through as a sequence of characters. The following simple C program illustrates the problem: #define _XOPEN_SOURCE 700 #include…
Ian
  • 402
  • 2
  • 16
0
votes
1 answer

Using different colors in the same stringstream with ncurses (C++)

I'm working on a code and I'm using ncurses and stringstreams (C++). I want to print (only) the number in red if it's negative and in green if it's positive. By the structure of the program, I use a single stringstream for the entire output. So if I…
Gyntonic
  • 346
  • 2
  • 4
  • 14
0
votes
0 answers

How to populate a sudoku (9x9) grid in ncurses?

I have a 9x9 sudoku grid that I've drawn using ncurses' (mvw)hline/vline functions and I'm now trying to populate it using numbers from a 9x9 array. My question is what is the most effective/efficient way to do this? If it's helpful, I'm using…
PavelF
  • 321
  • 1
  • 2
  • 11
0
votes
1 answer

NCurses with WSL Displaying Boxes Incorrectly

I am using ubuntu on my windows computer using the windows subsystem for linux to compile a simple program using ncurses in C that shows a box inside a ncurses window. As seen in the picture below, the box does not render fully. Is there something…
Brian Koch
  • 13
  • 5
0
votes
2 answers

curses move backwards accounting for previous lines

Is there any way to move the cursor backwards while accounting for previous lines, i.e. when the cursor goes back from the beginning of the line it goes to the last non-empty character of the previous line?
Tornado547
  • 231
  • 2
  • 10
0
votes
1 answer

How to Prevent Cursor From Reverting to Far Left of Screen after Newlines in Ncurses?

Using the function mvprintw(rowOffset, colOffset, textToPrint) from Ncurses, when I print a newline character, if colOffset is anything other than 0, I get a rectangle that looks like this: xxxxxxxx x x xxxxxxxx when I want the rest of the…
0
votes
1 answer

How to get text from screen in ncurses c++?

my goal is to get text from screen using ncurses in c++. To achieve this, I'm trying to use mvinstr() function, but I'm having problems with getting the arguments right - mostly the char *str. My guess is that it all comes down to my misuse of…
trommand
  • 21
  • 2
0
votes
2 answers

ncurses' has_colors() returns false. What is the problem?

I want to use color attributes in ncurses mode. But as stated in the topic, has_colors() returns false, meaning that the terminal does not support color manipulation. But using printf() and ansi color codes (not in ncurses mode), I can print color…
Mahdi.B
  • 57
  • 7
0
votes
1 answer

printw() and mvwprintw() do not print

I am trying to test both printw and mvwprintw by printing a string at each new line. However they do not print anything. This is the output on the terminal: gcc -c -g *.c gcc *.o -o main.exe -lncurses DBOJANTC-M-KDD5:ncursestest user22$…
A.boj
  • 1
  • 3
0
votes
0 answers

ncurses, how to get rid of a persistent character?

I am coding this very simple game to learn C on UNIX OSs. The 'C' character (the chicken), which is controlled by the player in the window, is followed by one or two predecessors. How should erase them? #include #include WINDOW…
Fabien
  • 3
  • 2
0
votes
1 answer

Ncurses waddch does not print character at cursor position

I am trying print the character ch at the cursor position in a 1x6 window. I want the cursor to move to the right if I input 's'/'k' and to the left if I input 'a'/'j'(and wrap around to the beginning/end of the window if the cursor is on the…
A.boj
  • 1
  • 3
0
votes
0 answers

Messy output on screen when running ncurses native android app from windows host

I am running an native ncurses statically build application for Ubuntu on Android device. I am getting the expected screen output on Ubuntu. I pushed the ncurses executable onto Android device which is connected to Windows host machine using…
Hithendra Nath
  • 173
  • 2
  • 10
0
votes
1 answer

How to avoid rewriting the pieces of text that don't change

I have developed a simple NCurses application that I use for debugging purposes. It constantly prints and updates some variables and their values on a terminal window. I'm using the printw function to print the variable names and their values like…
codeaviator
  • 2,545
  • 17
  • 42
0
votes
0 answers

How to output terminal control chars in ncurses?

I have a document with terminal control characters (raw characters, depending on how you name those) embedded to display bold fonts, set colors, etc. cat this document works fine. But I want to display this text in a ncurses program retaining its…
Cyker
  • 9,946
  • 8
  • 65
  • 93
0
votes
1 answer

Open a Graphical Window that uses Ncurses

Let's say I'm running xterm or some other terminal emulator on top of some graphical X Window Environment. xterm on KDE, for example. I want to write an application that may be called on the command line of one terminal emulator, and upon execution,…
Druid
  • 133
  • 3
  • 12