[GHC] #9364: GHCi (or haskeline?) confused by non-single-width characters

GHC ghc-devs at haskell.org
Mon Sep 7 02:26:36 UTC 2015


#9364: GHCi (or haskeline?) confused by non-single-width characters
-------------------------------------+-------------------------------------
        Reporter:  cheater           |                   Owner:
            Type:  bug               |                  Status:  new
        Priority:  normal            |               Milestone:
       Component:  GHCi              |                 Version:  7.8.3
      Resolution:                    |                Keywords:  linux,
                                     |  terminal, colour, color, prompt
Operating System:  Unknown/Multiple  |            Architecture:
                                     |  Unknown/Multiple
 Type of failure:  Other             |               Test Case:
      Blocked By:                    |                Blocking:
 Related Tickets:  #5850             |  Differential Revisions:
-------------------------------------+-------------------------------------

Comment (by joeljk13):

 Here's a more minimalistic way to see the first bug:

 To ~/.ghc/ghci.conf, add
 {{{
 :set prompt "^[[0m^O"
 }}}
 which can be done with
 {{{
 $ echo ":set prompt \"$(tput sgr 0)\"" >>~/.ghc/ghci.conf
 }}}

 Note that this prompt consists only of the terminal control sequence to
 reset any color, so effectively there should be no prompt at all.

 Then run ghci, type enough that it wraps to the next line, and press HOME.
 The cursor will move not to the very beginning of the line, as it should,
 but to column 4.

 I think the issue is simply that GHCi doesn't recognize terminal control
 sequences, and the fix would be to make it treat all terminal control
 sequences as width 0.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9364#comment:4>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list