patch ansi escape code for save/restore cursor