problem
When I run a curses program via windows cmd.exe
that outputs colored text I get an unselectable line on the bottom of the window.
How can I remove it?
example
import curses
def main(stdscr):
curses.init_pair(1, 200, 100)
stdscr.addstr("test ", curses.color_pair(1))
stdscr.refresh()
stdscr.getch()
curses.wrapper(main)
cause
The problem is that curses thinks that the terminal is smaller and resizes the window resulting in this line at the bottom.
If I do
curses.resize_term(10, 10)
a second line appears on the side and becomes way bigger; I guess this is the way cmd handle smaller terms
solution
to fix that bug I should use another terminal or say to the user that if he is on Windows he should not go on the cmd but use something like PowerShell
or Windows Terminal