# Check if running in VS Code inside startup.jl

**URL:** <https://discourse.julialang.org/t/check-if-running-in-vs-code-inside-startup-jl/95346>\
**Category:** VS Code\
**Tags:** startup\
**Created:** [February 28, 2023, 5:53pm UTC](https://discourse.julialang.org/t/check-if-running-in-vs-code-inside-startup-jl/95346 "2023-02-28T17:53:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![airpmb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/airpmb/32/7826_2.png) [@airpmb](https://discourse.julialang.org/u/airpmb)\
**Post date:** [February 28, 2023, 5:53pm UTC](https://discourse.julialang.org/t/check-if-running-in-vs-code-inside-startup-jl/95346/1 "2023-02-28T17:53:26Z")

</div>

Is there a way to determine, inside of `startup.jl`, whether a Julia REPL session is running inside of VS Code?

Checking if `Logging.current_logger() isa VSCodeServer.VSCodeLogger` seems to work once the REPL prompt is actually available, but in `startup.jl` will fail with `UndefVarError: `VSCodeServer` not defined` outside of an `atreplinit` or will return `false` if inside of one.

I guess other than at startup I’d be interested to know if there’s a way of checking if a script is running in VS Code but for now my use case is just at REPL startup, in order to decide whether or not to import certain things, e.g. OhMyREPL or TerminalExtensions.

---

<div class="post-metadata">

**Author:** ![piechologist](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/piechologist/32/27662_2.png) [@piechologist](https://discourse.julialang.org/u/piechologist)\
**Post date:** [February 28, 2023, 6:55pm UTC](https://discourse.julialang.org/t/check-if-running-in-vs-code-inside-startup-jl/95346/2 "2023-02-28T18:55:19Z")

</div>

You can check the environment for `ENV["TERM_PROGRAM"] == "vscode"`.
