<p dir="ltr">Yes, it is worth doing it, because until Haskeline has been fixed and integrated into ghci, the issue persists and needs to remain filed.</p>
<br><div class="gmail_quote"><div dir="ltr">On Fri, 8 Dec 2017 18:25 MarLinn, <<a href="mailto:monkleyon@gmail.com">monkleyon@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div text="#000000" bgcolor="#FFFFFF">
    <p>I opened an issue on the Haskeline github
      (<a class="m_-8449850070863793940moz-txt-link-freetext" href="https://github.com/judah/haskeline/issues/72" target="_blank">https://github.com/judah/haskeline/issues/72</a>).</p>
    <p>But it seems to be completely Haskeline-side, so I'm not sure if
      it's worth re-opening the one for ghci? As missing documentation
      maybe? <br>
      (BTW, I found this on the wiki:
      <a class="m_-8449850070863793940moz-txt-link-freetext" href="https://wiki.haskell.org/GHCi_in_colour" target="_blank">https://wiki.haskell.org/GHCi_in_colour</a>. Might be a good place to
      put it, if linked.)<br>
    </p>
    <p>If you want to, here are my test cases rewritten as ghci prompts:</p>
    <pre>    -- single line, positioning error
    :set prompt " \ESC[36m%\ESC[0m "
    -- single line, works
    :set prompt " \ESC[36m\STX%\ESC[0m\STX "
    -- multiline, bad output
    :set prompt "\ESC[32m\STX–––\ESC[0m\STX\n \ESC[36m\STX%\ESC[0m\STX "
    -- multiline, works but is inconsistent
    :set prompt "\ESC[32m–––\ESC[0m\n \ESC[36m\STX%\ESC[0m\STX "
</pre>
    In my tests, the positioning errors consistently happen if there are
    any "unclosed" escape-sequences on the last line of the prompt,
    regardless of its length. Escape sequences on previous lines
    consistently create "weird characters", but don't influence the
    positioning. Also regardless of their lengths. That makes sense, as
    both sets of lines seem to be handled quite differently.<br>
    <br>
    Are multiline prompts even used by a lot of people? I like mine
    because it gives me a both a list of modules and a consistent cursor
    position. But maybe I'm the exception?<br>
    <br>
    Cheers.</div><div text="#000000" bgcolor="#FFFFFF"><br>
    <br>
    <div class="m_-8449850070863793940moz-cite-prefix">On 2017-12-07 23:15, cheater00
      cheater00 wrote:<br>
    </div>
    <blockquote type="cite">
      <p dir="ltr">Interesting. Would you mind reopening the issue and
        providing a buggy example? Amd alerting haskeline maintainers?
        How does it work on a 1 line prompt that is so long it wraps?</p>
      <br>
      <div class="gmail_quote">
        <div dir="ltr">On Thu, 7 Dec 2017 23:11 MarLinn, <<a href="mailto:monkleyon@gmail.com" target="_blank">monkleyon@gmail.com</a>>
          wrote:<br>
        </div>
        <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
          > Here's what I use:<br>
          ><br>
          > :set prompt "\ESC[46m\STX%s>\ESC[39;49m\STX "<br>
          ><br>
          > I believe \STX is a signal to haskeline for control
          sequences.<br>
          > Documentation is here:<br>
          > <a href="https://github.com/judah/haskeline/wiki/ControlSequencesInPrompt" rel="noreferrer" target="_blank">https://github.com/judah/haskeline/wiki/ControlSequencesInPrompt</a><br>
          Note: If you're using a multi-line prompt, things may be
          different<br>
          again. I don't know what the rules are, but I found that if I
          put \STX<br>
          on any but the last line of prompts I get weird characters.
          The same<br>
          goes for any \SOH you might want to add for some reason.<br>
          <br>
          Cheers,<br>
          MarLinn<br>
          <br>
        </blockquote>
      </div>
    </blockquote>
    <br>
  </div>

_______________________________________________<br>
ghc-devs mailing list<br>
<a href="mailto:ghc-devs@haskell.org" target="_blank">ghc-devs@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs</a><br>
</blockquote></div>