[GHC] #8051: GHCi: confusing `:set +m`/`:{` interaction & wrong line-numbers in multi-line input

#8051: GHCi: confusing `:set +m`/`:{` interaction & wrong line-numbers in multi- line input ------------------------------------+------------------------------------- Reporter: hvr | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: GHCi | Version: 7.6.3 Keywords: | Operating System: Unknown/Multiple Architecture: Unknown/Multiple | Type of failure: None/Unknown Difficulty: Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | ------------------------------------+------------------------------------- As mentioned in ticket:8047#comment:1 GHCi exhibits a line-numbering offset bug when multi-line input is evaluated. Morever, when `:set +m` is active, `:{`-entered multi-input may trigger multi-line input continuation, e.g.: {{{ Prelude> :set +m Prelude> :{ Prelude| let x = () Prelude| y = () Prelude| :} Prelude| z = () Prelude| Prelude> }}} The attached patch fixes both issues, but does so in an admittedly hacky way... -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8051 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8051: GHCi: confusing `:set +m`/`:{` interaction & wrong line-numbers in multi- line input -------------------------------------+------------------------------------ Reporter: hvr | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: GHCi | Version: 7.6.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Comment (by hvr): Btw, here's a minor fixlet for HEAD, which doesn't honor `prompt2` for `:set +m` multi-line input: {{{ #!diff diff --git a/ghc/InteractiveUI.hs b/ghc/InteractiveUI.hs index 4bac5ad..7b10b65 100644 --- a/ghc/InteractiveUI.hs +++ b/ghc/InteractiveUI.hs @@ -790,7 +790,7 @@ checkInputForLayout stmt getStmt = do _other -> do st1 <- lift getGHCiState let p = prompt st1 - lift $ setGHCiState st1{ prompt = "%s| " } + lift $ setGHCiState st1{ prompt = prompt2 st1 } mb_stmt <- ghciHandle (\ex -> case fromException ex of Just UserInterrupt -> return Nothing _ -> case fromException ex of }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8051#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8051: GHCi: confusing `:set +m`/`:{` interaction & wrong line-numbers in multi- line input -------------------------------------+------------------------------------ Reporter: hvr | Owner: Type: bug | Status: patch Priority: normal | Milestone: Component: GHCi | Version: 7.6.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Changes (by igloo): * status: new => patch -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8051#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8051: GHCi: confusing `:set +m`/`:{` interaction & wrong line-numbers in multi-
line input
-------------------------------------+------------------------------------
Reporter: hvr | Owner:
Type: bug | Status: patch
Priority: highest | Milestone: 7.8.1
Component: GHCi | Version: 7.7
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture: Unknown/Multiple
Type of failure: None/Unknown | Difficulty: Unknown
Test Case: | Blocked By:
Blocking: | Related Tickets:
-------------------------------------+------------------------------------
Changes (by thoughtpolice):
* priority: normal => highest
* version: 7.6.3 => 7.7
* milestone: => 7.8.1
Comment:
Herbert, after attempting to merge this patch, it causes two `./validate`
failures for me:
{{{
$ make TEST="ghci023 ghci047"
=====> ghci023(ghci) 2660 of 3765 [0, 0, 0]
cd ./ghci/scripts && HC='/home/a/ghc/ghc-pristine/inplace/bin/ghc-stage2'
HC_OPTS='-dcore-lint -dcmm-lint -dno-debug-output -no-user-package-db
-rtsopts -fno-ghci-history ' '/home/a/ghc/ghc-pristine/inplace/bin/ghc-
stage2' --interactive -v0 -ignore-dot-ghci -dcore-lint -dcmm-lint -dno-
debug-output -no-user-package-db -rtsopts -fno-ghci-history

#8051: GHCi: confusing `:set +m`/`:{` interaction & wrong line-numbers in multi-
line input
-------------------------------------+------------------------------------
Reporter: hvr | Owner:
Type: bug | Status: patch
Priority: highest | Milestone: 7.8.1
Component: GHCi | Version: 7.7
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture: Unknown/Multiple
Type of failure: None/Unknown | Difficulty: Unknown
Test Case: | Blocked By:
Blocking: | Related Tickets:
-------------------------------------+------------------------------------
Comment (by Herbert Valerio Riedel

#8051: GHCi: confusing `:set +m`/`:{` interaction & wrong line-numbers in multi- line input -------------------------------------+------------------------------------ Reporter: hvr | Owner: Type: bug | Status: closed Priority: highest | Milestone: 7.8.1 Component: GHCi | Version: 7.7 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Changes (by thoughtpolice): * status: patch => closed * resolution: => fixed Comment: Thanks for fixing this Herbert! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8051#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC