hook in ansi command handling