Ticket #101 (closed enhancement: fixed)

Opened 8 years ago

Last modified 7 years ago

read from /dev/tty when stdin isn't a terminal

Reported by: judah Owned by:
Priority: minor Milestone: 0.6.3
Version: 0.6 Keywords:


Darcs apply doesn't work when reading from a file with interactive mode:

darcs apply -i < foo.dpatch

In that case, Haskeline should read user input from stdin, like less.

Darcs ticket and email thread: http://bugs.darcs.net/issue1648 http://lists.osuosl.org/pipermail/darcs-users/2009-October/021861.html

There's two possible ways to do this:

  • Query an environmental flag (e.g. HASKELINE_FORCE_TTY).
  • Add a parameter to one of Haskeline's functions.

We need to figure out the Darcs use cases in order to decide which way is better.

Change History

Changed 7 years ago by judah

  • status changed from new to closed
  • resolution set to fixed
  • milestone set to 0.6.3

Resolved by the addition of Modes to the API. In particular, runInputTForMode preferTermMode will read input from the user's terminal, if possible.

Note that if Haskeline can't connect to the terminal, it will still read from stdin. The function haveTerminalUI checks for that case.

Note: See TracTickets for help on using tickets.