Ihor Radchenko writes: > We can try the attached patch. Yet another edge case in comint, it > appears. I investigated further and now applied a set of patches that improves prompt filtering in org-comint. https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=a8a516ba330fe8c435334030ffbe371b8c80c877 https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=866ed1a3c5c37cad243085f9a8fa904970e4d614 Further, I tried to incorporate Pareto's suggestion about secondary prompt and cleaned up the original GHCi tests. With the attached set of patches (first one is Bruno's original patch), I get all the tests reliably passing, except the tests left as :expected-result failed. The remaining tests fall into two categories: 1. Tests trying to test :results value vs. :results output in sessions. 2. Tests trying to test for multiple sessions not interfering each other. The first category of tests fails because `org-babel-interpret-haskell' simply cannot distinguish between :results value and :results output. Someone familiar with GHC should handle this problem. For example, by wrapping :results output code in such a way that output is discarded in the GHCi comint buffer. The second category of tests fails because haskell-mode uses a fixed "*haskell*" comint buffer name. As I suggested in another message, a viable approach could be renaming the original "*haskell*" buffer to something else in `org-babel-haskell-initiate-session'. Again, someone more familiar with haskell-mode should judge if such option is truly viable.