Updated C++ terminal code to latest.