1

I have the following scenario:

I have a Windows in a VM, which has an exposed serial port to a host pipe (named-pipe / fifo).

The host pipe is at /tmp/win-serial-com3.

On my host OS, I'm using socat like so:

socat - /tmp/win-serial-com3,cr

On the guest, I'm opening PuTTY, and set "implicit LF in every CR", and local echo is enabled. PuTTY opens COM3 on that guest Windows.

With both running, return keys work fine, there is no doubling, etc. I can type into the PuTTY and I can see each character appear one after another in the terminal in my host OS, where socat is running.

However, when I type something in my host OS, I can see the local echo (as it is not switched off with echo=0 option), but the character will appear in PuTTY on my guest os, only after hitting return.

What I'd like to happen, is that each time I press a key, that key is sent to the named pipe, essentially having the same behavior as PuTTY on the guest OS.

I assume this has something to do with buffering of STDIO (-), but I'm not exactly sure.

1

OK, I found the solution, and it took quite a bit of trial and error:

On the host side (Linux), this is how socat has to be invoked:

stty -icanon && socat - /tmp/win-serial-com3,cr

On the Guest side, PuTTY has to be invoked with "Implicit LF in every CR", and unset "Implicity CR in every LF", in the "Terminal" settings.

It's still not ideal.

When I press backspace on the host side, it prints a ^?, instead of erasing the previous character. On the guest side, this works alright. When pressing backspace on the guest side, it erases the characters on the guest side, but not on the host side. I have yet to find a way to get backspace working.

  • Did you have any luck finding a solution to the backspace issue? – Joffrey Mar 29 at 17:02
  • @Joffrey nope. I haven't pursued the issue further, though. However I plan to get back to it eventually. – polemon Mar 29 at 20:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.