-int my_custom_handler(RoteTerm *rt __attribute__((unused)), const char *es)
-{
- int color;
- int i, j;
-
- /* if the escape sequence does not begin with '{', we give up */
- if (*es != '{') return ROTE_HANDLERESULT_NOWAY;
-
- /* ok, now we know it begins with '{'. Now, if it does not end with '}',
- * it is not yet complete */
- if (es[strlen(es)-1] != '}') return ROTE_HANDLERESULT_NOTYET;
-
- /* ok, the sequence is complete */
- color = atoi(es + 1);
- if (color < 0 || color > 7) return false; /* don't recognize it */
-
- /* paint the background with that color */
- attrset(COLOR_PAIR(color * 8));
- move(0, 0);
- for (i = 0; i < screen_h; i++) for (j = 0; j < screen_w; j++) addch(' ');
- touchwin(stdscr);
- refresh();
-
- /* touch term_win to force it to do a full redraw next time */
- touchwin(term_win);
-
- /* and redraw the terminal window */
- wrefresh(term_win);
-
- /* escape sequence was handled ok */
- return ROTE_HANDLERESULT_OK;
-}
-