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
54
votes
1 answer

Canonical vs. non-canonical terminal input

I am studying for an exam and I am confused as to how canonical vs. non-canonical input/output works in Unix (e.g., curses). I understand that there is a buffer to which "line disciplines" are applied for canonical input. Does this mean that the…
titaniumdecoy
  • 18,900
  • 17
  • 96
  • 133
46
votes
4 answers

How do I use (n)curses in Ruby?

I'd like to create a progress bar to indicate the status of an a batch job in Ruby. I've read some tutorials / libraries on using (n)curses, none of which were particularly helpful in explaining how to create an "animated" progress bar in the…
Jake McGraw
  • 55,558
  • 10
  • 50
  • 63
44
votes
7 answers

Curses alternative for windows

Is there any alternative of the curses module for python to use in windows? I looked up in the python documentation, but there its mentioned that its for using in unix. I am not much familiar with these, so is there some way to use curses module in…
Chandan
  • 749
  • 1
  • 8
  • 11
42
votes
6 answers

Setupterm could not find terminal, in Python program using curses

I am trying to get a simple curses script to run using Python (with PyCharm 2.0). This is my script: import curses stdscr = curses.initscr() curses.noecho() curses.cbreak() stdscr.keypad(1) while 1: c = stdscr.getch() if c == ord('p'):…
user1017102
  • 787
  • 1
  • 7
  • 14
41
votes
3 answers

What is needed for curses in Python 3.4 on Windows7?

I have a running Python 2.7/3.4 installation on my Windows 7 (x64) machine. I would like to test curses on Windows. Curses is installed but not working: >>> import curses Traceback (most recent call last): File "", line 1, in
Paebbels
  • 15,573
  • 13
  • 70
  • 139
38
votes
5 answers

ImportError: No module named '_curses' when trying to import blessings

I am trying to run this: from blessings import Terminal t = Terminal() print (t.bold('Hi there!')) print (t.bold_red_on_bright_green('It hurts my eyes!')) with t.location(0, t.height - 1): print ('This is at the bottom.') Which is the first…
Nazarii Morhun
  • 489
  • 1
  • 4
  • 3
37
votes
8 answers

How to use terminal color palette with curses

I can't get the terminal color palette to work with curses. import curses def main(stdscr): curses.use_default_colors() for i in range(0,7): stdscr.addstr("Hello", curses.color_pair(i)) stdscr.getch() curses.wrapper(main) This…
chtenb
  • 14,924
  • 14
  • 78
  • 116
33
votes
5 answers

Python Curses Handling Window (Terminal) Resize

This is two questions really: how do I resize a curses window, and how do I deal with a terminal resize in curses? Is it possible to know when a window has changed size? I really can't find any good doc, not even covered on…
Pez Cuckow
  • 14,048
  • 16
  • 80
  • 130
29
votes
2 answers

Python ncurses, CDK, urwid difference

What's the difference between these 3? As far as I understand it they both provide binding to curses which is the C library for terminal text-based UI. I currently have no knowledge of any of the 3 and I've never used curses. Which one would you…
s5s
  • 11,159
  • 21
  • 74
  • 121
27
votes
6 answers

How to scroll text in Python/Curses subwindow?

In my Python script which uses Curses, I have a subwin to which some text is assigned. Because the text length may be longer than the window size, the text should be scrollable. It doesn't seem that there is any CSS-"overflow" like attribute for…
lecodesportif
  • 10,737
  • 9
  • 38
  • 58
24
votes
6 answers

CMake can't find Curses

I am trying to compile the openlase library from www.marcansoft.com and have been running into problems with CMake. CMake is returning an error stating that it cannot find Curses, and after a lot of looking I am still stumped as to what the issue…
waffleShirt
  • 385
  • 1
  • 3
  • 11
24
votes
2 answers

Learning Ruby Curses

Does anyone know of any good tutorials for learning Ruby with Curses? I just can't seem to find one and the doc is very vague. I have never used curses before so I really don't know much about it.
deuces
  • 733
  • 1
  • 10
  • 17
21
votes
3 answers

How do I detect arrow keys pressed using curses in C?

In trying to get input from the arrow keys via curses (ncurses) it won't catch as KEY_UP etc. I used the keypad function with a true argument but getch still returned an escaped sequence. How do I shift through the values returned by getch() and…
James
20
votes
3 answers

How to refresh curses window correctly?

while 1: ... window.addstr(0, 0, 'abcd') window.refresh() ... window size is full terminal size, big enough to hold abcd. If 'abcd' is modified to shorter string like 'xyz', then on terminal I will see 'xyzd'. What exactly I am…
Pablo
  • 28,133
  • 34
  • 125
  • 215
20
votes
5 answers

Error no module named curses

When I try to run the following code... from telnetsrvlib import * if __name__ == '__main__': "Testing - Accept a single connection" class TNS(SocketServer.TCPServer): allow_reuse_address = True class TNH(TelnetHandler): def cmdECHO(self,…
Strommer
  • 353
  • 1
  • 2
  • 9
1
2 3
66 67