Fix terminal corruption, now the UI work can start