5
votes

Is it possible to configure stack ghci similar to the way ghci is configured via the ~/.ghci file?

Currently stack ghci does not pick up the settings in the ~/.ghci file.

I'm looking into setting the prompt to be a lambda instead of the loaded modules:

:set prompt "\ESC[33m\STXλ> \ESC[m\STX"

Update

[neo@nixos:~/HaskellLearning/IdeTest]$ stack ghci The following GHC options are incompatible with GHCi and have not been passed to it: -threaded Configuring GHCi with the following packages: IdeTest Using main module: 1. Package `IdeTest' component exe:IdeTest-exe with main-is file: /home/neo/HaskellLearning/IdeTest/app/Main.hs GHCi, version 8.2.2: http://www.haskell.org/ghc/ :? for help Loaded GHCi configuration from /home/neo/HaskellLearning/IdeTest/.ghci Loaded GHCi configuration from /home/neo/.ghci [1 of 9] Compiling Ch13
( /home/neo/HaskellLearning/IdeTest/src/Ch13.hs, interpreted ) [2 of 9] Compiling Ch15 ( /home/neo/HaskellLearning/IdeTest/src/Ch15.hs, interpreted ) [3 of 9] Compiling Ch17 ( /home/neo/HaskellLearning/IdeTest/src/Ch17.hs, interpreted ) ... Ok, 9 modules loaded. Loaded GHCi configuration from /run/user/1000/ghci31082/ghci-script *Main Ch13 Ch15 Ch17 Functor HelloError Lib Phone SemigroupAndMonoid>

None of the other 2 configurations mentioned does anything regarding changing the prompt.

1
I only use stack ghci and it definitely picks up the settings in my ~/.ghci file. Is there something non-standard about your set-up?jkeuhlen
have you set your ~/.ghci file writable by just yourself? At least that's what my stack ghci complained about.epsilonhalbe
I haven't changed the ~/.ghci permissions. Does using NixOS count as non-standard about the set-up? :) Still, if I just run ghci instead it will pick the settings.Răzvan Flavius Panda
(You should probably say what the permissions were before you didn't change them.)Daniel Wagner
-rw-r--r-- and I am not getting any warning when running stack ghci. I'll update the question since it says it is using the settings but it is not applying them for some reason.Răzvan Flavius Panda

1 Answers

0
votes

Try to put your config under:

~/.ghc/ghci.conf

Works for me on Ubuntu 16.04.