Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

newlines not rendered on Windows telnet #3

Closed
proddy opened this issue Dec 29, 2018 · 3 comments
Closed

newlines not rendered on Windows telnet #3

proddy opened this issue Dec 29, 2018 · 3 comments

Comments

@proddy
Copy link

proddy commented Dec 29, 2018

Thanks for the great library. I'm using it in one of my projects to replace some home grown telnet logging libraries. I noticed when using Telnet on Windows the newlines are not left-justified. I think this is because you need a '\r' after a '\n'. For example using your stock example code in a Serial window it shows correctly as:

Connecting to WiFi . Connected!
Ready
IP address: 10.10.10.28

Type 'C' for WiFi connect.
Type 'D' for WiFi disconnect.
Type 'R' for WiFi reconnect.
All other chars will be echoed. Play around...

but in the telnet window:

                                Connecting to WiFi . Connected!
Ready
IP address: 10.10.10.28

Type 'C' for WiFi connect.
                          Type 'D' for WiFi disconnect.
                                                       Type 'R' for WiFi reconnect.
All other chars will be echoed. Play around...

Telnet connection established.

Works fine using telnet from Linux, like an ubuntu shell in Windows10 though.

@proddy
Copy link
Author

proddy commented Dec 30, 2018

I checked using putty with telnet and it also has the indent issue. I think somewhere in the write() when a newline is detected an additional '\r' must be added to the buffer, or something along those lines like this quick hack in write()

            addTelnetBuf(data);
            if (data == '\n') {
                addTelnetBuf('\r'); // added by proddy
            }

@yasheena
Copy link
Owner

There is a solution without adding code:
In the putty configuration (Category:) click on "terminal" and check the line "Implicit CR in every LF".

@proddy
Copy link
Author

proddy commented Dec 30, 2018 via email

@proddy proddy closed this as completed Jan 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants