title: How to display pre-colored string with curses?
body: <p>I'm writing a curses program in Python. I'm a beginner of curses but I've used terminal control sequences for colored output.</p>
  
  <p>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.</p>
  
  <p>Initially I feed pygments output directly to <code>window.addstr()</code>, but it is turned out that the control sequences is escaped and the whole highlighted string is printed on the screen (just like this: <a href="https://too-young.me/web/repos/curses-highlight.png" rel="noreferrer">https://too-young.me/web/repos/curses-highlight.png</a>). How can I display it directly with curses, just like <code>cat</code>?</p>