cronvel / terminal-kit

Terminal utilities for node.js
MIT License
3.08k stars 198 forks source link

Telnet: NaN garbage after pressing enter #213

Open cherbert opened 2 years ago

cherbert commented 2 years ago

Hi, I am playing around with this library and trying to get it running within a Telnet server so I can have people connect via a terminal app.

When using the input example with autocomplete I get a lot NaN returns after pressing enter. I have made a little video showing. Initially I was using putty but that was all over the place and the input was jumping to the top of the page. I then looked at ZOC Terminal.

Is this library not really meant for remote connections? Do I need a better telnet library to run my server in Node? Do you recommend? I have also added a link to my code.

https://pastebin.com/KZ5zQmdn

https://user-images.githubusercontent.com/2813418/187221187-d2a47aa5-b1f4-4be0-a795-e55723802daa.mp4

cronvel commented 1 year ago

@cherbert It should works, but there is something wrong with some escape sequences. Unfortunately, it's hard to tell from the video alone... I could probably fix the NaN thing, but if that appears, it means the escape sequence could not be parsed properly, which means it would break anyway.

To be honest, I can't even say which part of the stack is at fault: it could be your terminal MidnightBlue, or the Node.js telnet module you are using. Also I'm not very familiar with telnet nowadays, but I tested the lib through SSH, and it was OK.