How to display pre-colored string with curses?
问题 I'm writing a curses program in Python. I'm a beginner of curses but I've used terminal control sequences for colored output. Now there's some code snippets to print inside the window, I'd like them be syntax highlighted, and it's better done with libraries like pygments, which outputs highlighted code with control sequences. Initially I feed pygments output directly to window.addstr() , but it is turned out that the control sequences is escaped and the whole highlighted string is printed on