# Restore session in VSCode: ERROR: LoadError: IOError: connect: connection refused (ECONNREFUSED)

**URL:** <https://discourse.julialang.org/t/restore-session-in-vscode-error-loaderror-ioerror-connect-connection-refused-econnrefused/78022>\
**Category:** General Usage\
**Created:** [March 17, 2022, 12:32pm UTC](https://discourse.julialang.org/t/restore-session-in-vscode-error-loaderror-ioerror-connect-connection-refused-econnrefused/78022 "2022-03-17T12:32:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Post date:** [March 17, 2022, 12:32pm UTC](https://discourse.julialang.org/t/restore-session-in-vscode-error-loaderror-ioerror-connect-connection-refused-econnrefused/78022/1 "2022-03-17T12:32:56Z")

</div>

In one computer, when I restart VScode, I’m getting this error in the Julia session:

```julia
julia> 

 Session contents restored from 3/17/2022 at 9:30:27 AM 

ERROR: LoadError: IOError: connect: connection refused (ECONNREFUSED)
Stacktrace:
 [1] wait_connected(x::Base.PipeEndpoint)
   @ Sockets ~/.julia/juliaup/julia-1.7.2+0~x64/share/julia/stdlib/v1.7/Sockets/src/Sockets.jl:532
 [2] connect
   @ ~/.julia/juliaup/julia-1.7.2+0~x64/share/julia/stdlib/v1.7/Sockets/src/Sockets.jl:567 [inlined]
 [3] connect
   @ ~/.julia/juliaup/julia-1.7.2+0~x64/share/julia/stdlib/v1.7/Sockets/src/PipeServer.jl:97 [inlined]
 [4] serve(args::String; is_dev::Bool, crashreporting_pipename::String)
   @ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.5.11/scripts/packages/VSCodeServer/src/VSCodeServer.jl:100
 [5] top-level scope
   @ ~/.vscode/extensions/julialang.language-julia-1.5.11/scripts/terminalserver/terminalserver.jl:45
in expression starting at /home/leandro/.vscode/extensions/julialang.language-julia-1.5.11/scripts/terminalserver/terminalserver.jl:24

```

I don’t really expect to have a recovered Julia session on restart, so maybe I just want do disable the automatic Julia session launching that happens whenever I open it.

Or is it something that should be working better?

To be clear: this happens only if I quit VSCode without manually ending the Julia session (the REPL), which causes it the automatically restart when I open VSCode back.

---

<div class="post-metadata">

**Author:** ![oheil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oheil/32/220745_2.png) [@oheil](https://discourse.julialang.org/u/oheil)\
**Post date:** [March 17, 2022, 12:38pm UTC](https://discourse.julialang.org/t/restore-session-in-vscode-error-loaderror-ioerror-connect-connection-refused-econnrefused/78022/2 "2022-03-17T12:38:45Z")

</div>

I have the same issue for a while now.

---

<div class="post-metadata">

**Author:** ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Post date:** [March 17, 2022, 12:45pm UTC](https://discourse.julialang.org/t/restore-session-in-vscode-error-loaderror-ioerror-connect-connection-refused-econnrefused/78022/3 "2022-03-17T12:45:59Z")

</div>

Also worth mentioning that the session opened automatically on startup is broken here, any command takes forever. So there is no other option other than quitting it and starting a new session.

---

<div class="post-metadata">

**Author:** ![pfitzseb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pfitzseb/32/45566_2.png) [@pfitzseb](https://discourse.julialang.org/u/pfitzseb)\
**Post date:** [March 17, 2022, 1:41pm UTC](https://discourse.julialang.org/t/restore-session-in-vscode-error-loaderror-ioerror-connect-connection-refused-econnrefused/78022/4 "2022-03-17T13:41:39Z")

</div>

Disable the `terminal.integrated.enablePersistentSessions` setting. Next release of the extension plays well with the persistent sessions functionality built into VS Code (aka can opt out of it).
