Skip to content

*haskell* jumping working directory to parent on exit #35

@chrisdone

Description

@chrisdone

Subject: haskell jumping working directory to parent on exit
From: Per Fredelius per.fredelius@gmail.com
To: haskellmode-emacs@projects.haskell.org

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions