It crashes on startup on terminals that don't support colours.
This corrupts the save file, making it crash all the next times too.
To reproduce, run:
TERM=vt100 ./botany.py
It is possible to detect whether the terminal supports colours by checking curses.COLORS. This is the number of colours supported. If no colours are supported it is 0.
EDIT: curses.COLORS doesn't seem to work, but using curses.has_colors() does.
It crashes on startup on terminals that don't support colours. This corrupts the save file, making it crash all the next times too.
To reproduce, run:
It is possible to detect whether the terminal supports colours by checking
curses.COLORS
. This is the number of colours supported. If no colours are supported it is 0.EDIT:
curses.COLORS
doesn't seem to work, but usingcurses.has_colors()
does.