Plugins: How to determine ghc vs ghci

Levent Erkok erkokl at gmail.com
Tue Nov 24 07:37:28 UTC 2015


I'm working on a plugin, and would like to be able to tell if it's GHC or
GHCi that's running.

I tried:

   df   <- getDynFlags
   let isGHCi = ghcMode df == CompManager

Alas, while that correctly tells apart "ghci" from "ghc -c", it also
returns True when ghc is called without the "-c" argument.

Is there a better/more robust way of figuring out whether we're in an
interactive session?

-Levent.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20151123/773e147b/attachment.html>


More information about the ghc-devs mailing list