If you run using ./x16emu -echo raw -log k | ../x16-petscii2utf8/petscii2utf8.
When you write 10 PRINT and press Enter you get:
In the x16emu emulator you only move to the next line. Also, it prints scan codes until you get READY! by typing RUN and Enter.
I have studied my code, but cannot find the bug. Maybe something unusual is sent when pressing Enter after a program line. Pressing Enter after commands works.
This can be studied by using: ./x16emu -echo raw -log k | xxd.