[GHC] #11695: On GHCi prompt the arrow (movement) keys create strange character sequences

GHC ghc-devs at haskell.org
Mon May 30 17:03:48 UTC 2016


#11695: On GHCi prompt the arrow (movement) keys create strange character sequences
---------------------------------+--------------------------------------
        Reporter:  heisenbug     |                Owner:
            Type:  bug           |               Status:  infoneeded
        Priority:  normal        |            Milestone:
       Component:  GHCi          |              Version:  8.1
      Resolution:                |             Keywords:
Operating System:  Linux         |         Architecture:  x86_64 (amd64)
 Type of failure:  None/Unknown  |            Test Case:
      Blocked By:                |             Blocking:
 Related Tickets:                |  Differential Rev(s):
       Wiki Page:                |
---------------------------------+--------------------------------------

Comment (by heisenbug):

 Replying to [comment:9 judahj]:
 > Let's try this.  Can you please download the file Read.hs from:
 > https://gist.github.com/judah/5c5ad518bb43d235efba4fa8f1e9953a
 >
 > And run (in the same terminal/environment that you have the ghci
 problem):
 > {{{
 > ghc Read.hs
 > ./Read
 > }}}
 >
 > Then press some letter keys and some arrow keys, and let me know what
 the output is?
 > For example, on my terminal:
 > {{{
 > $ ./Prompt
 > "a"
 > "s"
 > "d"
 > "\ESC[D"
 > "\ESC[B"
 > "\ESC[A"
 > }}}
 > The last three lines are from when I pressed arrow keys.  Do you see
 them split into separate lines (e.g. "\ESC", "[" and "D")?  If so, that's
 the problem we should try to solve.  Does the same behavior of Read.hs
 occur on laptop<-vnc->hostA, or only on laptop<->hostA<->hostB?

 I see stuff like this:


 {{{
 "\ESC[C"
 "\ESC["
 "C"
 "\ESC[C"
 "\ESC[C"
 "\ESC[C"
 "\ESC[C"
 "\ESC[C\ESC[C"
 "\ESC[C"
 "\ESC[C"
 }}}

 Ha, this looks funny:

 {{{
 "\ESC[B"
 "\ESC[B"
 "\ESC[B\ESC[B\ESC[B\ESC[B\ESC[B"
 "\ESC[B"
 "\ESC[B"
 "\ESC[B"
 "\ESC[B"
 "\ESC[B"
 "\ESC[B"
 "\ESC[B"
 "\ESC[B\ESC[B\ESC[B"
 "\ESC[B"
 "\ESC[B\ESC[B"
 "\ESC[B\ESC[B"
 "\ESC[B"
 "\ESC[B"
 }}}

 Above sequences happen when via VNC.

 Let me test putty...

 ... completely dull. The strings look like this:

 {{{
 "\ESC[B"
 "\ESC[B"
 "\ESC[B"
 "\ESC[B"
 "\ESC[B"
 "\ESC[B"
 "\ESC[B"
 "\ESC[B"
 "\ESC[B"
 "\ESC[B"
 "\ESC[B"
 "\ESC[B"
 "\ESC[B"
 "\ESC[B"
 "\ESC[B"
 }}}

 Hope this helps!!

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


More information about the ghc-tickets mailing list