<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<body text="#000000" bgcolor="#FFFFFF">
<p>I opened an issue on the Haskeline github
(<a class="moz-txt-link-freetext" href="https://github.com/judah/haskeline/issues/72">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
(BTW, I found this on the wiki:
<a class="moz-txt-link-freetext" href="https://wiki.haskell.org/GHCi_in_colour">https://wiki.haskell.org/GHCi_in_colour</a>. Might be a good place to
put it, if linked.)<br>
<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 "
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>
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>
<div class="moz-cite-prefix">On 2017-12-07 23:15, cheater00
<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>
<div dir="ltr">On Thu, 7 Dec 2017 23:11 MarLinn, <<a
<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>
> :set prompt "\ESC[46m\STX%s>\ESC[39;49m\STX "<br>
> I believe \STX is a signal to haskeline for control
> Documentation is here:<br>
rel="noreferrer" target="_blank" moz-do-not-send="true">https://github.com/judah/haskeline/wiki/ControlSequencesInPrompt</a><br>
Note: If you're using a multi-line prompt, things may be
again. I don't know what the rules are, but I found that if I
on any but the last line of prompts I get weird characters.
goes for any \SOH you might want to add for some reason.<br>