1. update the default directory according to the output of VT100/ANSI-style terminal