Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,867
    • Issues 4,867
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 456
    • Merge requests 456
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #21287
Closed
Open
Created Mar 23, 2022 by Jakob Brünker@JakobBruenkerDeveloper

GHCi reports successfully loading ghci.conf even if reading fails

Summary

When the encoding isn't set up properly to match the encoding of the ghci.conf file, loading the commands from the file fails, but GHCi still claims to have loaded it.

Steps to reproduce

Example ghci.conf (Note the λ which causes the problem):

putStrLn "XXX Start"
:set prompt "λ "
:set prompt-cont "| "
putStrLn "XXX End"

in shell:

$ LANG=en_US.UTF8 ghci
GHCi, version 9.2.1: https://www.haskell.org/ghc/  :? for help
XXX Start
XXX End
Loaded GHCi configuration from /home/user/.ghc/ghci.conf
λ 
$ LANG=0 ghci
GHCi, version 9.2.1: https://www.haskell.org/ghc/  :? for help
XXX Start
Loaded GHCi configuration from /home/user/.ghc/ghci.conf
ghci> 

As you can see, it fails before putStrLn XXX End` is reached, and the prompt is incorrect.

Expected behavior

Report some kind of error instead of success (ideally that the encoding is wrong, at least that reading the file failed)

Environment

  • GHC version used: 9.2.1

Optional:

  • Operating System: Arch
  • System Architecture: x86_64
Edited Mar 29, 2022 by Jakob Brünker
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking