sshwifty icon indicating copy to clipboard operation
sshwifty copied to clipboard

[enter] keypress is not immediately sent to target

Open VladimirSergeevichRU opened this issue 2 years ago • 4 comments

We run the sshwifty in docker container. Session to target is opened as expected, but when we try to send a typed command by pressing [Enter] nothing happens. Pressing any other key after pressing [Enter] does the trick. E.g. we type command show and press the [Enter] key. Nothing happens. Then we press another (any) key. The command is sent.

VladimirSergeevichRU avatar Jan 06 '24 16:01 VladimirSergeevichRU

Hi, sorry for the inconveniences.

Were you trying to operate a Telnet remote or non-linux shell though Sshwifty? If so, it might not working correctly.

Sshwifty currently only supports sending only LF sequence when enter key is pressed, while some shell expects sequence such as CRLF or CR.

This is a known issue, but I'm currently lack of energy and time to properly test and fix it. Again, sorry for the inconveniences.

nirui avatar Jan 07 '24 02:01 nirui

Yes, target is a device that has its own telnet server and a hardware console. An we are actually seeing two issues.

  1. Sshwifty connects via telnet protocol to a device itself. This way, any character we type on the termial gets duplicated.
  2. Sshwifty connects via telnet to a moxa nport, which has a serial connection to a target console port. This way, to have the [Enter] keypress passed, we need to press any other key after [Enter] each time.

Thank you for the answer. We cannot reconfigure the CRLF/LF/CR option for the device's telnet. We tried to set different option for that in moxa, but it didn't help at all.

If you have any ideas were to look, could you nudge us in that direction? We might perhaps be able to fiddle with code a little, or get some debug info, do some tests. Anyway this is not urgent! Thanks!

VladimirSergeevichRU avatar Jan 07 '24 15:01 VladimirSergeevichRU

Well, Sshwifty probably need a complete over haul in order to properly support Telnet, and it takes time to get it right, that's the reason why I hasn't started working on this currently.

The duplicated output problem is probably caused by echoing. Sshwifty supports local as well as remote echos, but the remote needs to tell Sshwifty what to do (some don't).

In addition to that, Sshwifty uses a Terminal called xterm.js, which is a XTerm emulator. So right off the bag it limits which PTY/Shell it can support without proper input/output conversion. And based on my readings, the conversion is not a light work.

All and all, it's not going to happen in a short term. Plus, I need to get quite a few things sorted before I can get back to work on Sshwifty. So don't hold your breath for this. Sorry for the disappointment.

nirui avatar Jan 08 '24 06:01 nirui

No problem! Thank you very much for your work, and explanation.

VladimirSergeevichRU avatar Jan 08 '24 13:01 VladimirSergeevichRU