Skip to content

Commit 250526b

Browse files
committed
Fix out-of-order session startup.
Previously the responses to the startup commands could be delayed, arriving so late that they appeared to be in response to later commands (e.g. a :load). By setting the prompt last, only one prompt marker will be sent for the whole startup procedure.
1 parent 513d589 commit 250526b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

haskell-commands.el

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,11 @@ You can create new session using function `haskell-session-make'."
8787
:state process
8888

8989
:go (lambda (process)
90-
(haskell-process-send-string process ":set prompt \"\\4\"")
90+
;; We must set the prompt last, so that this command as a
91+
;; whole produces only one prompt marker as a response.
9192
(haskell-process-send-string process "Prelude.putStrLn \"\"")
92-
(haskell-process-send-string process ":set -v1"))
93+
(haskell-process-send-string process ":set -v1")
94+
(haskell-process-send-string process ":set prompt \"\\4\""))
9395

9496
:live (lambda (process buffer)
9597
(when (haskell-process-consume

0 commit comments

Comments
 (0)