*haskell* jumping working directory to parent on exit

Per Fredelius per.fredelius at gmail.com
Wed May 2 21:05:56 BST 2012


I have the following issue: If I do this:

1. Load up a module Test.Test using C-c C-l
2. Close the ghci session using ':q'
3. Try open a new session using C-c C-l *without* closing the *haskell* buffer.

Then ghci will give me an error, the module can not be found. Using
getCurrentDirectory (in System.Directory) will tell me why. Current
directory has been switched from previous session. It is now in the
previous directories parent directory. So if my testmodule has path
parentfolder/myfolder/Test/Test.hs the working directory will become
parentfolder/myfolder the first time and parentfolder the second time.

If I do close the buffer in between sessions the issue does not occur.

A friend suggested that haskell mode will look for cabal files and
sometimes change directory to one having one. I've tried moving my
cabal file around to no avail.

I'm still an emacs newbie so I may have confused some things up. I'm
not sure what happens, only the end result. This issue is mainly an
actual issue for me because of modules that cause ghci to crash when
closing them because of 'misbehaving' non-haskell dependencies
(opengl). Debugging would be much less of a hassle if I can trust in
C-c C-l.

Thanks in advance



More information about the Haskellmode-emacs mailing list