GHCi reports successfully loading ghci.conf even if reading fails
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"
$ 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.
Report some kind of error instead of success (ideally that the encoding is wrong, at least that reading the file failed)
- GHC version used: 9.2.1
- Operating System: Arch
- System Architecture: x86_64