judah / haskeline

A Haskell library for line input in command-line programs.
https://hackage.haskell.org/package/haskeline
BSD 3-Clause "New" or "Revised" License
221 stars 75 forks source link

fix escape codes splitting across `getBlockOfChars` #161

Open goertzenator opened 3 years ago

goertzenator commented 3 years ago

This patch adds a 20ms timeout to getBlockOfChars when an ESC character is seen. This forces getBlockOfChars to wait for a whole escape sequence which could otherwise get fragmented on a slow connection.

Some useful reference information on this topic: https://stackoverflow.com/a/3219355/398021

Fixes issue #160