<div dir="ltr">Thanks! That indeed does work.<div><br></div><div>I'm a bit surprised though that there isn't already an internal boolean set somewhere; checking for a string in the arguments sounds a bit fragile.<br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Nov 24, 2015 at 12:28 AM, Aycan İrican <span dir="ltr"><<a href="mailto:iricanaycan@gmail.com" target="_blank">iricanaycan@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">How about `GHC.Environment.getFullArgs` which includes “—interactive” when you’re in GHCi?<br>
<div><div class="h5"><br>
<br>
> On 24 Nov 2015, at 09:37, Levent Erkok <<a href="mailto:erkokl@gmail.com">erkokl@gmail.com</a>> wrote:<br>
><br>
> I'm working on a plugin, and would like to be able to tell if it's GHC or GHCi that's running.<br>
><br>
> I tried:<br>
><br>
>    df   <- getDynFlags<br>
>    let isGHCi = ghcMode df == CompManager<br>
><br>
> Alas, while that correctly tells apart "ghci" from "ghc -c", it also returns True when ghc is called without the "-c" argument.<br>
><br>
> Is there a better/more robust way of figuring out whether we're in an interactive session?<br>
><br>
> -Levent.<br>
</div></div>> _______________________________________________<br>
> ghc-devs mailing list<br>
> <a href="mailto:ghc-devs@haskell.org">ghc-devs@haskell.org</a><br>
> <a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs</a><br>
<br>
</blockquote></div><br></div></div></div>