detect console mode

I am using a linqpad script and i have this line Console.Title=...

Is there a way to detect that i am running in "program" mode so that i can skip this step when i am using the LinqPad application rather than the console?

Comments

  • JoeAlbahari
    edited February 2025

    You can use the CMD symbol to identity when you're running from the command-line (lprun) rather than the GUI.

    #if CMD
    "lprun".Dump();
    #endif
    

    Does that answer your question?