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

Windows translating \n to \r instead of \r to \n #5

Open
paigeruten opened this issue Apr 6, 2017 · 1 comment
Open

Windows translating \n to \r instead of \r to \n #5

paigeruten opened this issue Apr 6, 2017 · 1 comment

Comments

@paigeruten
Copy link
Contributor

See: https://www.reddit.com/r/programming/comments/63lssy/build_your_own_text_editor/dfvlcoc

I have some issues with "Entering raw mode" on Bash for windows.

The flags you provide dont "enable" Ctrl+M and Ctrl+J echoes 13 instead of 10.

raw.c_iflag &= ~(INLCR);

This lets Ctrl+J output the expected 10.

raw.c_iflag &= ~(IGNCR);

This unblocks Ctrl+M and outputs the expected 13.

I wasn't able to reproduce this behaviour and, for some reason, the reporter of the bug wasn't able to either.

@ghost
Copy link

ghost commented Apr 10, 2017

Had the same issue - for me it was because I typed "raw.c_(LOWER CASE L)flag &=..." for each of the lines. Correcting the lines to "raw.c_iflag, raw.c_oflag, raw.c_cflag, raw.c_lflag" completely resolved the issue.
Enter key outputs "13" as does ctrl+m.

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

1 participant