Questions tagged [ncurses]

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

Filter by
Sorted by
Tagged with
0 votes
0 answers
21 views

Alsamixer Like Terminal Interface with NCurses

I'm a ncurses newbie and I'm trying to imitate Alsamixer's terminal interface. I was able to do it up to a certain level, but I have troubling to implement menu dynamics. What I want is to navigate ...
-1 votes
0 answers
53 views

How to define its own color in curses without painting the whole background with it?

Is it possible to define its own color (and not updating a color which is already defined by ncurse). After having consulted the documentation: https://tldp.org/HOWTO/NCURSES-Programming-HOWTO/color....
  • 4,979
-1 votes
2 answers
66 views

Function `can_change_color()` of ncurses not working although my terminal (tmux + alacritty) can display 24-bits colors

I get the following error message with the following code when compilig with gcc script.c -lncurses on my macos 11.6.1 2 different terminals (tmux with alactritty and iterm2): /* quest.c */ #include &...
  • 4,979
0 votes
0 answers
25 views

Trouble compile C code containing ncurses library: "Undefined symbols for architecture x86_64:" [duplicate]

I am trying to use the library ncurses on my macos 11.6.1 with the terminal alacritty. When I try to compile this code (copied from there: https://www.viget.com/articles/game-programming-in-c-with-the-...
  • 4,979
2 votes
2 answers
96 views

Color palette and more scale variations

I have here two code so you can help me understand... Well at first my mask colors the "loading" shape. The initials rgbkmcw indicate their colors, red, ..., white. These are normal, already ...
  • 147
-1 votes
1 answer
41 views

I'm trying to read from a file in C and I have debugged all my errors except for one that I can't figure out [closed]

My buddy and I are working on a simple project, and we decided to go with C this time. We are relatively new to C but wanted to give it a shot anyways. We are trying to read a file and print it to the ...
0 votes
0 answers
16 views

Is it possible to configure ncurses to hardcode a terminfo path relative to the executable instead of an absolute path? [duplicate]

I am building ncurses from source (and then linking my application to it) as part of the build process for my application, and I have observed that the built binaries have the absolute path of the ...
  • 70.4k
0 votes
0 answers
30 views

Unable to wrap shared pointer over ncurses WINDOW raw pointer returned by newwin()

I am using ncurses in one of my projects. Creating windows in ncurses by the newwin() function returns a WINDOW* pointer. I want to avoid the use of raw pointers in my code as it is not best practice ...
1 vote
0 answers
49 views

problems with fedora and libtinfo.so.6 [duplicate]

I am currently on F37 and I get the following problem when I try to run a program that uses ncurses; I wrote the program myself, but I was able to get it working on other distros. ./others: /lib64/...
  • 11
0 votes
1 answer
87 views

how to install ncurses on windows

How can I make ncurses work on my windows? I've tried every way to make it work but my gcc compiler doesn't recognize it, it's installed correctly in the directory C:\msys64\mingw64\include\ncurses I ...
  • 1
0 votes
2 answers
52 views

ncurses: alternative to mvwprintw

I'm looking for an alternative to the mvwprintw function. My problem is that this function moves the cursor and the puts the text on the screen. Is there an alternative that does the same except it ...
  • 425
1 vote
1 answer
24 views

magic number in compiled format of tic

I am reading about the terminfo file format and the format of tic compiled files. I found the documentation of this format, but in this documentation they write about the first two bytes in the file ...
0 votes
1 answer
38 views

G++ Failing to link ncurses even though it has the -lncurses flag [duplicate]

I'm trying to compile an ncurses file using g++. It gives this output which would suggest that it isn't linking correctly. Interestingly it compiles fine under clang++. I have ncurses installed from ...
1 vote
1 answer
29 views

GoNCurses refresh background window after foreground window moves

I am trying to understand how does ncurses work. Here is one example I am struggling to understand and make it work. First the idea: Window 1 (stdscr) with background and printed text Window 2 (sWin) ...
  • 589
0 votes
0 answers
20 views

(Ncurses) Wbkgd not working (while colors do)

Every color prints correctly, but the background doesn't (no matter what pair I use) No matter what I try I can't get it to work I also checked the docs, I honestly can't find the issue here #include &...
0 votes
1 answer
67 views

my ncurses window isn't appearing on my terminal

I'm new to Ncurses and I tried to make a program in C++ that makes a window then displays a box and text on both the box and standard screen. Here is my code #include <iostream> #include <...
1 vote
2 answers
107 views

ncurses program using MinGW-w64 fails with "Error opening terminal: xterm"

I am trying to write a very simple ncurses program, just to play around with, using mingw-w64 on Windows 10. I installed the mingw-w64-x86_64-ncurses package with pacman, and am using the MSYS2 ...
0 votes
0 answers
64 views

(Windows) ncurses linking issues

I'm really getting an headache here. I'm trying to get ncurses running on my system, but the compiler returns this fatal error: "ncurses.h: no such file or directory". Can anybody make some ...
-1 votes
1 answer
157 views

ModuleNotFoundError: No module named '_curses' on Ubuntu 22.04

I want to use curses for a personnal Python project. However, when I try to import it, I get the following error : >>> import curses Traceback (most recent call last): File "<stdin&...
  • 669
0 votes
0 answers
89 views

How do I draw a perfect square in ncurses?

Pretty much what the title says. I want to draw a perfect square or at least as squarish as possible in the terminal. To be precise, I want to draw a 5x5 board but I'll manage that if I get to know ...
0 votes
0 answers
33 views

Seg fault in C program that uses bash command by system() function [duplicate]

Im trying to make program print whole content of folder by asking user for path to folder where the content is and then by using system() function I want program to make .txt file with output of ls ...
  • 5
1 vote
0 answers
40 views

Why are colors not displaying when using ncurses? [closed]

I'm trying to write a simple program with ncurses that just displays some yellow text #include <ncurses.h> int main() { initscr(); noecho(); if (!has_colors()) { mvaddstr(1, 1, &...
-1 votes
1 answer
102 views

How to make terminal emulator using c++ and display the output in ncurses window?

#include "Terminal.h" void Terminal::send_buffer_to_terminal(std::string buffer) { input << buffer << std::endl; input << "echo " << delimiter <&...
0 votes
0 answers
65 views

How to convert true color to ncurses color values

So, I want to make an algorithm that converts hex color to ncurses color values. For example: std::string bar = "#A400C6"; init_pair(1, foo(bar), COLOR_BLACK); // foo will return ...
0 votes
0 answers
46 views

new_menu() fails when then menu has an odd number of items (!=1)

I'm trying to create a menu in ncurses and the number of items in the menu can change on every call to my function, but if I run this when I have (3,5) unique items in the menu, I get a crash and gdb ...
0 votes
0 answers
36 views

Is there any way to draw large characters using ncursesw?

I want to create a main page for a program I'm trying to write and basically, I want to print the title at the center with a large font and menu and the rest after that. What I'm looking for is any ...
0 votes
1 answer
21 views

no pdcures.dll created when using make -f Makefile for win 10 pdcurses

I have been trying to install PDcurses on my Windows 10 machine. The README.md says to run: make -f Makefile to build pdcures.dll in the 'wincon' folder. However when i ran this in Powershell it did ...
0 votes
0 answers
29 views

Ncurses - Issue with A_DIM effect and init_color

Issue I have recently come across an issue, I can't figure out where it comes from. It appears to be related to an unexpected behavior of the ncurses library when attempting to apply the A_DIM effect ...
  • 1,271
0 votes
0 answers
32 views

Pi Unable to locate libncurses or libncurses

I attempted to include ncurses in my code and got this error: fatal error: ncurses.h: No such file or directory 1 | #include <ncurses.h> I wanted to install the ncurses library to my raspbian OS ...
1 vote
2 answers
77 views

Refresh screen every 1 second with ncurses

I want to refresh the screen every one second. I'm implementing a chat with ncurses. So far, I have the following function: void print_chat(char *chat) { mvprintw(1, 1, "RPC Chat"); ...
0 votes
0 answers
28 views

Python ncurses program stops working when resizing command prompt to mininimum size

I'm currently facing a problem where my program seems to work fine when the windows cmd has a height of at least 3 rows. However when the cmd is resized smaller than that, ncurses stops updating the ...
  • 1
0 votes
0 answers
23 views

printing a message on window after i pressed enter, c using ncurses

I work on a project to implement the WORDLE game in C using ncurses. I have a problem. I need to implement the functionality when I pressed enter before I typed five letters to print on the window a ...
0 votes
2 answers
100 views

maintain the colour of every line in C with ncurses

I implement the Worldle game in C using ncurses library. When I added a new word,I color each character depending on the case: Green if the letter is in the same position as in the guessing word, ...
0 votes
0 answers
71 views

Ncurses in C, implement backspace

I'm working on a project to build wordle game with ncurses library. At this moment, I'm stuck because I try to implement backspace and it didn't work. Here is my code: #include <ncurses.h> #...
0 votes
0 answers
44 views

Detect whether Shift is presses with ncurses [duplicate]

I am writing a ncurses program in C++, which allows the user to press keybindings to execute tasks. However, because there are too many keybindings, I decided to add some modifier keys. One of the ...
0 votes
1 answer
63 views

clock() behavior in ncurses

This is the reduced code to demonstrate the behavior. #include <stdio.h> #include <ncurses.h> #include <time.h> #define DELAY 2.0 int main ( void) { static clock_t start; ...
  • 8,166
1 vote
2 answers
46 views

How to implement independent movement apart from user input in Ncurses with C?

I'm trying to have an "o" move down independent from user input. I plan on using user input for another object. Without the if statement, "o" will increase and go down. With a ...
  • 11
3 votes
1 answer
69 views

Segmentation fault in C <curses.h>

I am very new in coding, so dont be very critical, if I made a simple mistake... I am self-taught, so you are the only one I can ask. Thanks to everyone who will help! I am trying to make something ...
  • 31
0 votes
1 answer
70 views

ncurses: program exiting when arrow key pressed

my question is exactly as the title says. My program exits right after I press an arrow up. Here's my program: pub fn main() !void { _ = c.initscr(); defer _ = c.endwin(); var i: u32 = 0; ...
  • 425
0 votes
1 answer
80 views

error: member access into incomplete type 'WINDOW' (aka '_win_st')

I have problems accessing _maxx, it says: ./ScoreBoard.hpp:20:38: error: member access into incomplete type 'WINDOW' (aka '_win_st') mvwprintw(score_win, 0, score_win->_maxx - 10, "%11llu"...
0 votes
1 answer
37 views

Why don't appear window created by ncurses?

A new window with input must appear. But instead just a standard ncurses's window displays. #define _POSIX_C_SOURCE 200201L #include <stdlib.h> #include <curses.h> #include <time.h> ...
0 votes
1 answer
103 views

How to get white (or other) color on FBTERM and CURSES without scrambling BOX drawing characters?

My question & current states: I'm writing TUI software that is on fbterm using python-curses library. My objective here is to get some colors, most importantly PURE WHITE color. My current state: ...
  • 103
0 votes
0 answers
47 views

Is there a way to listen for keyboard input without pausing the loop of a program in C?

Okay, so i'm currently working on a duplicate of T-Rex game from Chrome, the one that is available if you do not have internet access. I am trying to do it in C language and use ncurses library for ...
0 votes
1 answer
16 views

caret in mvprintw but only in loop

I have the following program #include <ncurses.h> int main() { initscr(); const char c = static_cast<char>(65); mvprintw(0, 0, "%s", &c); getch(); endwin(...
  • 7,307
-1 votes
1 answer
41 views

How to change string on every iteration in ncurses widow?

I need to make program which take value of pressed key and displays on window corresponding string. While user not press key enter, he can press keys arrow again and string will change every time ...
1 vote
1 answer
102 views

fake/mock/background terminal for testing an ncurses application

I am working with an(other) legacy C application which has a text user interface written using ncurses. I would like to script some tests of the program running but it will only run in a terminal. ...
  • 4,709
0 votes
1 answer
39 views

ncurses and key codes after fork

I don't understand why the arrow keys code changes after forking in a WINDOW. The up arrow returns 259, but after the fork 65. If I run the same program on stdscr, it returns 65 already at the ...
0 votes
1 answer
46 views

What can I replace with the sleep command in the Windows variant of ncurses?

#include <curses.h> #include <unistd.h> #include <iostream> int main() { initscr(); mvaddstr(10, 10, "Hello, world"); refresh(); sleep(4); endwin(); ...
0 votes
1 answer
58 views

Problem with printing extended ascii using ncurses

I have got problem with printing extended ascii in terminal using wprintw function. This program prints letters instead squares. I was trying to change my locales but without effect. What should I ...
0 votes
1 answer
33 views

C: Bus Error between function returns and execution goes back to parent function

To simplify the problem as much as possible, I have two functions, a parent that calls the child. Everything executes okay till it gets to the return of the child function. After that I get a Bus ...

1
2 3 4 5
37