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
2 answers

Handle signals in ncurses

I am writing a program in C using ncurses.I am trying to handle the CRTL C signal. In my code, this signal is being caught and dealt with but the program is not termination correctly. Could it be the way I am exiting from ncurses? //handle SIGINT…
CXB
  • 241
  • 5
  • 14
0
votes
2 answers

Is there an alternative to getch(); which won't pause the program?

I'm writing a game currently in ncurses and I have a ship that is controlled by the user and an 'automated' that moves slowly down the lines to kill you. However, I'm using a while loop containing everything and each time I use getch() the loop…
Jamstain
  • 1
  • 1
  • 1
0
votes
2 answers

How to read a key in Go but continue application if no key pressed within x seconds?

This is an easy way to read a key from the console reader := bufio.NewReader(os.Stdin) // ... func readKey() rune { char, _, err := reader.ReadRune() if err != nil { fmt.Println("Error reading key: ", err) } return…
Another Prog
  • 841
  • 13
  • 19
0
votes
1 answer

NCurses using backspace

Hello I have this code and the backspace is not work properly while((ch=getch())!='\n') { ++counter; noecho(); if (ch == KEY_BACKSPACE || ch == KEY_DC || ch == 127) { counter--; delch(); delch(); …
0
votes
0 answers

How to perform raster scan of the curses screen to the file in python

I am creating one call flow based on the content from one input file to the curses screen (window). I could successfully create the call flow to the curses screen. I would like to perform the raster scan of the curses screen and to write into the…
Vignesh Sivam
  • 75
  • 1
  • 8
0
votes
1 answer

Dynamic array of windows, Ncurses

I am currently creating an array in C of a dynamic number of Ncurses windows. However, windows are an "incomplete type" so their size can be variable. How can I create a variable size array of windows if calloc crashes when invoked with…
jellies
  • 639
  • 1
  • 5
  • 17
0
votes
1 answer

Using IO with Ncurses

I am trying to use UI.NCurses https://john-millikin.com/software/haskell-ncurses/reference/haskell-ncurses/latest/ for some simple path finding lessons The issue is I have a random Int which of course returns an IO Int which then means I have an IO…
liminal18
  • 563
  • 7
  • 21
0
votes
1 answer

Reason linking to pthreads causes a change in program behavior?

When linking to pthreads I get unexpected behavior during program execution, the ncurses interface becomes unresponsive, but the program does not crash. This is without using any pthread functionality, no threading headers or anything related to…
A-n-t-h-o-n-y
  • 410
  • 6
  • 14
0
votes
0 answers

store characters from array of pointers to normal array

I would like to display the words inside buffer, except for the first word. Elements of buffer point to the following strings: buffer[0] = "print" buffer[1] = "hello" buffer[2] = "my" … Code: char **buffer = getArray(); /* works OK */ char…
lfarr
  • 17
  • 6
0
votes
1 answer

cursor in ncurses window not in the required position

I am using ncurses to build my own terminal. My main window contains 5 other windows. The window which I have positioned below, is the prompt panel. I would like text to be entered there and as well I want the ability to input text in there. I have…
lfarr
  • 17
  • 6
0
votes
2 answers

How does ncurses output non-ascii characters?

I'd like to know how ncurses (a c library) manages to put characters like ├, despite them not (to the best of my knowledge) being part of ASCII. I would have assumed it was just drawing them pixel by pixel, but you can copy/paste them out of the…
Jones
  • 1,154
  • 1
  • 10
  • 35
0
votes
1 answer

Segmentation fault when dividing string using malloc

I am using ncurses to create my own terminal. I get the string and save it in a 2D array, buffer[80][256]. I get the string using getstr(buffer[i]). Then I have the following in the main function; while (strcmp(buffer[i],"exit")!=0) { …
lfarr
  • 17
  • 6
0
votes
2 answers

How to stop backspace from appearing in nCurses using C?

I am currently writing an ncurses shell and in order to read input it is important to read it character by character and hence I am using the mvwgetch command. And incrementing a counter as it reads character by character. The problem is that…
griz
  • 119
  • 7
0
votes
1 answer

Getting the integer value of a ncurses chtype or unsigned char in C++

I'm trying to get the integer value of ncurses alternative character sheet characters. #include int main() { uint i = ACS_S7; //I've also tried other values std::cout << i << std::endl; } just prints 0 though.
Jones
  • 1,154
  • 1
  • 10
  • 35
0
votes
2 answers

ncurses forms: Show editing cursor / highlight active field

I’m new to programming and I’d like to realise the following with ncurses in C: A form with fields to fill out and underneath this form, there is a continuously changing sensor value to be observed by the user during filling out the form, which…
Wonnegrausen
  • 1
  • 1
  • 4