Terminal function emulator.