Your problem is that the code is running in a terminal emulator that does not seem to support VT100 control codes. Try using a different terminal, such as the one built into vscode.