This is called when a prompt template is updated. It processes
abbreviations used in the prompt template (like #) and calculates how
many invisible characters (ANSI colour escapes) the resulting prompt
contains.

It is also called for each prompt on changing the colour scheme. In both
cases, traitlets should take care of calling this automatically.