EnableGUI hack changes working directory

Hello, the EnableGUI hack for getting a window in GHCi on Mac OS X (10.3.9 for me) unexpectedly changes the working directory for the running ghci [...] apfelmus$ ghci -i../../Hackage/SOE/src [...] GHC Interactive, version 6.6.1, for Haskell 98. *Main> :! pwd /Users/apfelmus/Documents/Programmierung/Haskell/Graphics/Kunst *Main> enableGUI >> run lambda Loading package OpenGL-2.2.1 ... linking ... done. Loading package GLFW-0.1 ... linking ... done. *Main> :! pwd /opt/local/lib/ghc-6.6.1 The effect is that reloading the Main module now fails *Main> :r <no location info>: can't find file: Main.hs Any solution? Btw, using enableGUI exactly once at the beginning of the ghci session doesn't work *Main> enableGUI <interactive>: ../../Hackage/SOE/src/EnableGUI.o: unknown symbol `_CPSEnableForegroundOperation' unless ghci is started with the -framework Carbon option. But then, the working directory remains fine, so I guess the change of working directory bug happens while dynamically loading frameworks/shared libraries. Is there a way to automate ghci ... EnableGUI -framework Carbon and typing enableGUI at the first prompt? Something like a custom shell script ghci+gui or even ghci --with-gui ? Regards, apfelmus

apfelmus wrote:
Is there a way to automate ghci ... EnableGUI -framework Carbon and typing enableGUI at the first prompt?
I have the following in my .ghci file: -- Read GHCI commands from the file whose name is -- in the GHCIRC environment variable :def _load const(System.Environment.getEnvironment>>=maybe(return"")readFile.lookup"GHCIRC") :_load :undef _load That allows me to easily define shell commands that open all kinds of specialized GHCi environments. Hope this helps, Yitz
participants (2)
-
apfelmus
-
Yitzchak Gale