bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Restarting Curses


From: Nicholas Cole
Subject: Restarting Curses
Date: Thu, 3 Sep 2009 15:30:29 -0400

Dear Curses List,

I have a strange problem.  I have code that can start up and close
down curses making sure the terminal is reset.  But if I call it a
second time, the terminal is not properly reset.  I'm using python,
but I suspect it would be the same in C.  What might I be doing wrong?

Python curses provides a wrapper function precisely for the purpose of
setting up the terminal and then resetting it, and the same behaviour
happens whether I use that or set up curses myself.

Minimal code looks something like:

#def wrapper(call_function):
#       locale.setlocale(locale.LC_ALL, '')
#       screen = curses.initscr()
#       curses.noecho()
#       curses.cbreak()
#       
#       return_code = call_function(screen)
#       
#       curses.nocbreak()
#       curses.echo()
#       curses.endwin()

As I say, it seems to work the first time it is called, but not the
second.  Any insights?

Best wishes,

N




reply via email to

[Prev in Thread] Current Thread [Next in Thread]