# How to embed Julia in interactive mode

**URL:** https://discourse.julialang.org/t/how-to-embed-julia-in-interactive-mode/112264
**Category:** General Usage
**Tags:** question, embedding
**Created:** [March 29, 2024, 2:22am UTC](https://discourse.julialang.org/t/how-to-embed-julia-in-interactive-mode/112264 "2024-03-29T02:22:51Z")
**Posts on this page:** 1
**Showing post:** 1

<div class="post-metadata">

### Author: ![droodman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/droodman/32/26652_2.png) [@droodman](https://discourse.julialang.org/u/droodman)
#### Post date: [March 29, 2024, 2:22am UTC](https://discourse.julialang.org/t/how-to-embed-julia-in-interactive-mode/112264/1 "2024-03-29T02:22:51Z")

</div>

Another in my continuing series of questions about how to embed Julia… @mkitti and @GunnarFarneback have been very helpful in the past.

I am embedding Julia in another program and am trying to approximately simulate the REPL. To this end I would like to launch Julia in interactive mode. My understanding is that this would affect, for example, the behavior of [soft scoping](https://docs.julialang.org/en/v1/manual/variables-and-scoping/#local-scope).

However, when I launch it after passing the `-i` option, `isinteractive()` still returns `false`. Here’s my code, in Windows:

```julia
#include <julia.h>
int main(int argc, char* argv[])
{
    int ac = 2;
    char**av = (char**)malloc(sizeof(char*) * 2);
    av[0] = 0;
    av[1] = (char*)"-i";
    jl_parse_opts(&ac, &av);

    jl_init();

    jl_eval_string("print(isinteractive())");

    jl_atexit_hook(0);
    return 0; 
}

```

Result:

```julia
false

```

Suggests welcome.

---

_[View the full topic](https://discourse.julialang.org/t/how-to-embed-julia-in-interactive-mode/112264)._
