I'm writing a program on python curses and I was wondering if there is a way to block terminal resizing in order to prevent curses' crashing both on Linux and Windows. This is what happens.. Can I prevent this? Under Windows this does not happen cause window resizing doesn't influence prompt proportions... http://alessio.ragno.info/Before%20Resize.png http://alessio.ragno.info/After%20Resize.png
`
import curses
screenTest = curses.initscr()
boxTest = curses.newwin(24,80,0,0)
boxTest.box()
curses.noecho()
curses.cbreak()
curses.start_color()
screenTest.keypad(1)
curses.init_pair(1,curses.COLOR_BLACK, curses.COLOR_CYAN)
curses.init_pair(2,curses.COLOR_YELLOW, curses.A_NORMAL)
boxTest.border(0)
boxTest.addstr(1,1,78*"_")
boxTest.addstr(10,10,"Press ESC to quit...")
boxTest.refresh()
x = screenTest.getch()
while x != 27:
boxTest.addstr(1,1,78*"_")
boxTest.addstr(10,10,"Press ESC to quit...")
boxTest.refresh()
x = screenTest.getch()
curses.endwin()
exit()
`
See Question&Answers more detail:os