luvit / lit

Toolkit for developing, sharing, and running luvit/lua programs and libraries.
http://lit.luvit.io/
Apache License 2.0
245 stars 58 forks source link

readline: also handle line feed for Enter #324

Open Bilal2453 opened 6 months ago

Bilal2453 commented 6 months ago

Is there a reason this isn't already the case? Apparently some systems will use a line feed (\010) instead of a carriage return (\013).

Not handling line feed on those systems results in a "Unhandled Key" error when enter is pressed.

On Linux when an enter is pressed apparently line feed ('\010") is used (which makes sense) but on most systems an stty option onlcr automatically converts that into a carriage return, which is why readline doesn't fail on those systems. Seems like when this onlcr option is not enabled readline will fail although.

This was reported as a question over on the Discord server by @Be1zebub.

Bilal2453 commented 2 months ago

@truemedian can you give this a quick look?