Export TERM=screen-256color at the right moment.