Questions tagged [curses]

Curses is a library for unix-ish computers that you can use to have better and more interactive consoles, including colors. It is used in some console games, like the original Rogue.

Curses is a library for unix-ish computers that you can use to have better and more interactive consoles, including colors. It is used in some console games, like the original Rogue.

See also: -

1003 questions
5
votes
1 answer

Curses - Certain emoji (flags) deform terminal output

When I output certain emoji (specifically flags) into a subwindow in curses, it deforms the output, even for output outside of that subwindow. Running: import curses def draw_screen(stdscr): event = 0 stdscr.clear() stdscr.refresh() …
Tom Anthony
  • 791
  • 7
  • 14
5
votes
0 answers

How should widgets be resized in npyscreen (a Python curses wrapper)?

I want the height of some widgets in my npyscreen app to resize as the terminal is resized. Specifically I want those two column widgets to continue to take up about the same fraction of the height of the terminal when the terminal is resized, with…
BlandCorporation
  • 1,324
  • 1
  • 15
  • 33
5
votes
1 answer

Custom RGB colors with Python curses

I'm writing a program in Python using the curses module in the standard library. I want my program to just exit if it can't use custom colors I specify with RGB triples. So I have some starter code that looks like: import curses def main(stdscr): …
math4tots
  • 8,540
  • 14
  • 58
  • 95
5
votes
0 answers

curses keyboard doesn't work after def_prog_mode and reset_prog_mode, refresh

I am trying to go from my ncurses UI to an editor via a system call and then back again. With the help of several friendly programmers here, I learned how to use def_prog_mode and refresh to restore the state of my terminal UI after the user…
ty.
  • 10,924
  • 9
  • 52
  • 71
5
votes
2 answers

get the text in the display with ncurses

Is there any way to get back the characters outputted into a variable on ncurses ? let's say I do: printw("test"); then I want to be able to: somefunc(strbuffer); printf("%s",strbuffer); // test I need a function to get back all characters on the…
Anon
  • 927
  • 1
  • 9
  • 6
5
votes
3 answers

Which $TERM to use to have both 256 colors and mouse move events in python curses?

Currently if I set the TERM environment variable to 'xterm-1003' I can get mouse move events but I get crappy colors and curses.can_change_color() == False os.environ['TERM'] = 'xterm-1003' ... curses.mousemask(curses.ALL_MOUSE_EVENTS |…
Wulfire
  • 105
  • 3
5
votes
1 answer

Detecting a NUMLOCK / CAPSLOCK / SCRLOCK keypress/keyup in Python

In a game I'm developing, I want to detect a NUMLOCK keypress (or keyup), like registering a "callback" function when it gets pressed. I'm not asking to read its state in a given moment, I can do that already, nor I'm interested in changing its…
MestreLion
  • 12,698
  • 8
  • 66
  • 57
5
votes
2 answers

Curses array browsing with keyboard in Ruby

I'm trying to make a cli app in Ruby that takes a given array then then displays it as a list that I can browse with the arrow keys. I feel like I've already seen a library in Ruby that does this already, but I can't remember the name of it. I'm…
Peter Souter
  • 5,110
  • 1
  • 33
  • 62
5
votes
1 answer

Python/curses user input while updating screen

I'm currently coding an app U.I with python/curses and I was wondering if it is possible to ask the user to press keys (cbreak mode) to hide or show some panels or windows while the U.I is continuously updating. I read the official python docs about…
MCO System
  • 404
  • 5
  • 12
5
votes
1 answer

How do I delete a curse window in python and restore background window?

I'm working on python curses and I have an initial window with initscr(). Then I create several new windows to overlap it, I want to know if I can delete these windows and restore the standard screen without having to refill it. Is there a way?…
lesolorzanov
  • 3,536
  • 8
  • 35
  • 53
5
votes
2 answers

cross compile ghc curses not found

I tried to crosscompile from linux i386 to arm-linux-gnueabihf, but i cant make it happen, because it gives me this weird error while running 'make': checking ncurses.h usability... yes checking ncurses.h presence... yes checking for ncurses.h...…
Visionstar
  • 355
  • 2
  • 12
5
votes
1 answer

I need an example of overlapping curses windows using panels in python

I'm looking for an example on how to use curses.panel to maintain overlapping windows.
Mark Lakata
  • 19,989
  • 5
  • 106
  • 123
5
votes
1 answer

How can I print (☞゚ヮ゚)☞ with Ncurses?

I would like to print (☞゚ヮ゚)☞ with the Ncurses library using C++ in Ubuntu. First of all, you can do this by simply having: std::cout << "(☞゚ヮ゚)☞" << std::endl; And it works just fine. However, when printing using Ncurses, I think that you need to…
Saturn
  • 17,888
  • 49
  • 145
  • 271
5
votes
2 answers

How to delete a subwindow in the python curses module

I've got a curses application that uses subwindows, but I can't seem to be able to delete them. For example, this code doesn't work: import curses def fill(window, ch): y, x = window.getmaxyx() s = ch * (x - 1) for line in range(y): …
MageJohn
  • 127
  • 2
  • 7
5
votes
1 answer

Error while compiling ncurses app on Mac OS X

I'm trying to compile ncurses based app on Mac OS X 10.6.8 but I get this error. Undefined symbols for architecture x86_64: "_initscr", referenced from: _main in ccf8K8YG.o "_printw", referenced from: _main in ccf8K8YG.o "_stdscr",…
johe
  • 63
  • 4