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.
stack ghci allows you to load components and files of your project into ghci . It uses the same TARGET syntax as stack build , and can also take options like --test , --bench , and --flag . Similarly to stack build , the default is to load up ghci with all libraries and executables in the project.
GHCi is the interactive interface to GHC. From the command line, enter "ghci" (or "ghci -W") followed by an optional filename to load. Note: We recommend using "ghci -W", which tells GHC to output useful warning messages in more situations. These warnings help to avoid common programming errors.
ghc/ghci. conf. Windows: C:\Documents and Settings\<username>\Application Data/ghc/ghci. conf.
If you have installed the Haskell Platform, open a terminal and type ghci (the name of the executable of the GHC interpreter) at the command prompt. Alternatively, if you are on Windows, you may choose WinGHCi in the Start menu. And you are presented with a prompt. The Haskell system now attentively awaits your input.
Try to put your config under:
~/.ghc/ghci.conf
Works for me on Ubuntu 16.04.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With