[darcs-devel] [issue1578] mark-conflicts command gives empty prompt since darcs 2.2

Simon Michael bugs at darcs.net
Sat Aug 29 02:48:33 UTC 2009


Simon Michael <simon at joyful.com> added the comment:

Here's the transcript. This was hard to reproduce; it only happens after emacs shell 
buffer gets into a funny input-echoing mode, which it invariably does, for me, after a 
while. I would have taken this to the haskeline tracker, except that I can only 
reproduce it with darcs+haskeline. Judah, I hope this gives some clue.

1. Create conflicting repos and an unrecorded change so mark-conflicts will prompt. I'm 
sure there's an easier way to make darcs prompt.:

/tmp$ darcs init --repo r1; darcs get -q r1 r2 
/tmp$ cd r1; echo 1 >f; darcs add f; darcs record -a -m 'added f'
Finished recording patch 'added f'
/tmp/r1$ cd ../r2; echo 2 >f; darcs add f; darcs record -a -m 'added f'
Finished recording patch 'added f'
/tmp/r2$ darcs pull -a --allow-conflicts ../r1
Pulling from "/private/tmp/r1"...
Backing up ./f(-darcs-backup0)
We have conflicts in the following files:
./f
Finished pulling and applying.
/tmp/r2$ echo >>f
/tmp/r2$ darcs wh -s
M ./f +1

2. Run mark-conflicts in an emacs shell. Normally the prompt works:

/tmp/r2$ darcs mark-conflicts
This will trash any unrecorded changes in the working directory.
Are you sure?  [yn]  C-c C-cwithSignalsHandled: Interrupted!

/tmp$ darcs --version
2.3.0 (release)
/tmp$ emacs --version
GNU Emacs 23.1.1
...
/tmp$ env
TERM_PROGRAM=Apple_Terminal
SHELL=/bin/bash
TERM=dumb
TERM_PROGRAM_VERSION=240.2
EMACSPATH=/Applications/Emacs.app/Contents/MacOS/bin
EMACS=t
TERMCAP=
__CF_USER_TEXT_ENCODING=0x1F5:0:0
PAGER=cat
COLUMNS=89
LANG=en_US.UTF-8
INSIDE_EMACS=23.1.1,comint
...

3. Emacs shell goes into a funny mode after a while; note how each input line is echoed. 
Once this starts, the prompt no longer works, if darcs is built with haskeline:

/tmp/r2$ darcs mark-conflicts
darcs mark-conflicts
 [yn]  C-c C-c                    # <--- no prompt
withSignalsHandled: Interrupted!

/tmp/r2$ darcs2.2 mark-conflicts
darcs2.2 mark-conflicts
 [yn]  C-c C-c
withSignalsHandled: Interrupted!

/tmp/r2$ darcs2.1 mark-conflicts  # pre-haskeline darcs is not affected
darcs2.1 mark-conflicts
This will trash any unrecorded changes in the working directory.
Are you sure?  [yn]  C-c C-cwithSignalsHandled: Interrupted!

4. darcs is using Darcs.Utils.promptCharFancy which uses getInputChar.
But I failed to reproduce the problem with a haskeline test program:

/tmp$ cat test1.hs
cat test1.hs
import System.Console.Haskeline
main = runInputT defaultSettings $ getInputChar "prompt"
  
/tmp$ runhaskell test1.hs
runhaskell test1.hs
prompt  C-c C-c
test1.hs: test1.hs: interrupted

----------
status: waiting-for -> need-action
topic:  -ProbablyEasy

__________________________________
Darcs bug tracker <bugs at darcs.net>
<http://bugs.darcs.net/issue1578>
__________________________________


More information about the darcs-devel mailing list