finally working terminal emulator