Work correctly with virtual terminals