darcs

Issue 1633 make apply --interactive default

Title make apply --interactive default
Priority feature Status waiting-for
Milestone Resolved in
Superseder darcs apply -i tries to read user input from stdin (breaks redirection)
View: 1648
Nosy List darcs-devel, dmitry.kurochkin, jaredj, judah, kowey, twb
Assigned To
Topics ProbablyEasy

Created on 2009-10-02.09:58:29 by kowey, last changed 2010-06-24.10:46:48 by kowey.

Messages
msg8900 (view) Author: kowey Date: 2009-10-02.09:58:24
See http://wiki.darcs.net/DefaultSwitches

I think the best thing to do is just implement it and send it to the list for
debate.
msg8956 (view) Author: kowey Date: 2009-10-11.15:18:02
Do not implement this yet.
We need a solution to issue1648 first.
msg10409 (view) Author: kowey Date: 2010-03-22.12:45:24
Just noting that we revisited this during the 2010-03 sprint in Zurich.

Our conclusion was that before we need to research the problem more, and
determine if there was a portable way to reliably detect if we were on a
terminal or not.  Windows may be an issue here.

If there is one, we can re-open the discussion about how apply -i should
behave.

Judah: any chance you'd be able to look into this?
msg10442 (view) Author: judah Date: 2010-03-23.07:14:47
On Mon, Mar 22, 2010 at 5:45 AM, Eric Kow <bugs@darcs.net> wrote:
>
> Our conclusion was that before we need to research the problem more, and
> determine if there was a portable way to reliably detect if we were on a
> terminal or not.  Windows may be an issue here.
>
> If there is one, we can re-open the discussion about how apply -i should
> behave.
>
> Judah: any chance you'd be able to look into this?

Sure.  There's a Windows equivalent to /dev/tty ("CONIN$" and
"CONOUT$"); Haskeline already uses the latter but not yet the former.
I did some tests, and trying to open CONIN looks like a reliable way
to check whether we're in a console session.*

So I believe there's no technical barriers to a robust
terminal-checking in the backend of Haskeline.  The best approach
seems to me to add a function to Haskeline's API.  For example:

runInputTInTerm :: Settings m -> InputT m a -> m (Maybe a)

which tries to run the given action(s) using the terminal, even if
it's not stdin; and returns Nothing if it couldn't connect to
[/dev/tty,CONIN$].  This should give Darcs some flexibility in
deciding the exact semantics of apply -i.


*The one caveat: in a Cygwin X shell, we can't connect to CONIN.  But
Haskeline doesn't provide any interactive editing in that setting
anyway, so this seems OK to me.  (There's little I can do about that
unless GHC improves its Cygwin support.)
msg10444 (view) Author: kowey Date: 2010-03-23.10:07:21
I've taken the liberty of copying msg10409 and msg10402 from issue1648
for tracking.

We're still be blocking on that issue, but I think Judah has given us
enough information to start the discussion.
msg11570 (view) Author: kowey Date: 2010-06-24.10:46:47
OK, nobody seems to care enough about this to pick up the discussion on
http://lists.osuosl.org/pipermail/darcs-users/2010-March/023451.html

So I think the only thing to do is continue waiting for issue1648, and
then go implement
History
Date User Action Args
2009-10-02 09:58:29koweycreate
2009-10-11 15:18:05koweysetstatus: needs-implementation -> waiting-for
nosy: kowey, darcs-devel, jaredj, dmitry.kurochkin
superseder: + darcs apply -i tries to read user input from stdin (breaks redirection)
messages: + msg8956
2010-03-23 10:04:24adminsetnosy: + judah, twb
messages: + msg10409
2010-03-23 10:05:39adminsetmessages: + msg10442
2010-03-23 10:07:26koweysetmessages: + msg10444
2010-06-24 10:46:48koweysetmessages: + msg11570