haskell / 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

Feature request: multi-line input in interactive mode #69

Open xaverdh opened 7 years ago

xaverdh commented 7 years ago

A nice to have feature would be multi-line input in interactive mode. From the api perspective I envision passing a function as part of the configuration. This function gets called with the input (and possibly some meta information, such as the position of the cursor) every time the user types something at the prompt and then returns a status, indicating whether the input should be considered complete (or partial). This would for example allow implementing a multi-line mode where the input is accepted when it parses successfully or when a special key sequence is encountered (this would possibly require passing control characters to the envisioned function).

judah commented 5 years ago

For another possible API, see the description of the CoffeScript REPL here: https://github.com/purescript/purescript/issues/934