ghcid output on a mac: status appears in the title bar

133 Views Asked by At

Complete Haskell beginner here.

MacOS 12.2.1

I have installed Haskell with ghcup, and ghci 8.10.7 is installed. Excellent.

Following the instructions here, I have added ghcid

cabal update && cabal install ghcid

and created a project

mkdir myproject && cd myproject
cabal init -n --is-executable
cabal v2-run

and happily, "Hello Haskell!" appears.

When I run ghcid

ghcid "--command=ghci Main.hs"

from the root directory ("myproject"), I get this output

% ghcid "--command=ghci Main.hs"
Loading ghci Main.hs ...
GHCi, version 8.10.7: https://www.haskell.org/ghc/  :? for help

<no location info>: error: can't find file: Main.hs
Failed, no modules loaded.

No files loaded, GHCi is not working properly.
Command: ghci Main.hs

So I give ghcid some more information by explicitly passing app/Main.js

ghcid "--command=ghci app/Main.hs"
Loading ghci app/Main.hs ...
GHCi, version 8.10.7: https://www.haskell.org/ghc/  :? for help
[1 of 1] Compiling Main             ( app/Main.hs, interpreted )
Ok, one module loaded.

and the title of my terminal emulator says "All good, at 09:37:26 - myproject". I had expected to see the green text "All good" in the terminal, not in the title!

Making a typo in app/Main updates the title bar with "1 error - myproject", and doesn't update the "body" of the terminal with any info about the error.

I am using iTerm2 - doesn't matter what I set the emulation to (VT100, ansi, xterm, xterm-256).

I am sure I have some beginner's mis-understanding here, but I'd be grateful for some help.

Thanks

0

There are 0 best solutions below