# Please bring workspace() or an equivalent back

**URL:** <https://discourse.julialang.org/t/please-bring-workspace-or-an-equivalent-back/27948>\
**Category:** General Usage\
**Tags:** question\
**Created:** [August 24, 2019, 8:24pm UTC](https://discourse.julialang.org/t/please-bring-workspace-or-an-equivalent-back/27948 "2019-08-24T20:24:58Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![stochastic\_guy](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stochastic_guy/32/9877_2.png) [@stochastic\_guy](https://discourse.julialang.org/u/stochastic_guy)\
**Post date:** [August 24, 2019, 8:24pm UTC](https://discourse.julialang.org/t/please-bring-workspace-or-an-equivalent-back/27948/1 "2019-08-24T20:24:58Z")

</div>

From all the discussions I have read about Julia, I have got the impression that you are supposed to use Julia in long sessions than quitting and restarting Julia every now and then. But then the problem faced is an overcrowded workspace. While looking for ways to clear workspace I found that there used to be `workspace()` command until 0.7 and doesn’t exist anymore. Or are there any workarounds that I’m not aware of?

---

<div class="post-metadata">

**Author:** ![sylvaticus](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sylvaticus/32/203883_2.png) [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Post date:** [August 24, 2019, 8:38pm UTC](https://discourse.julialang.org/t/please-bring-workspace-or-an-equivalent-back/27948/2 "2019-08-24T20:38:30Z")

</div>

As workaround type this in your global or user-defined startup.jl file and restart Julia:

```julia
function workspace()
  atexit() do
    run(`$(Base.julia_cmd())`)
  end
  exit()
end

```

It defines a custom “workspace” function that first instructs to open a new Julia function when Julia terminates, and then indeed exits the current Julia process.

---

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [August 24, 2019, 10:17pm UTC](https://discourse.julialang.org/t/please-bring-workspace-or-an-equivalent-back/27948/3 "2019-08-24T22:17:07Z")

</div>

Tried this and get an error message:

```julia
julia> function workspace()
       atexit() do
       run($(Base.julia_cmd()))
       end
       exit()
       end
ERROR: syntax: "$" expression outside quote

julia> 

```

---

<div class="post-metadata">

**Author:** ![baggepinnen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/baggepinnen/32/693_2.png) [@baggepinnen](https://discourse.julialang.org/u/baggepinnen)\
**Post date:** [August 25, 2019, 12:27am UTC](https://discourse.julialang.org/t/please-bring-workspace-or-an-equivalent-back/27948/4 "2019-08-25T00:27:52Z")

</div>

The whole point was to _not_ terminate Julia so as to not repeatedly pay the compilation price…

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [August 25, 2019, 7:57am UTC](https://discourse.julialang.org/t/please-bring-workspace-or-an-equivalent-back/27948/5 "2019-08-25T07:57:09Z")

</div>

Yeah, I personally think we should bring it back as well. We load packages in a different way now which should reduce some of the weirdness associated with `workspace` back in 0.6

---

<div class="post-metadata">

**Author:** ![sylvaticus](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sylvaticus/32/203883_2.png) [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Post date:** [August 27, 2019, 9:25am UTC](https://discourse.julialang.org/t/please-bring-workspace-or-an-equivalent-back/27948/6 "2019-08-27T09:25:54Z")

</div>

Sorry, I was on my mobile and not giving the code-formatting to the code resulted in the backquotes getting lost in the forum software.  
Just use: `run(`$(Base.julia_cmd())`)` (as a workaround only of course)

---

<div class="post-metadata">

**Author:** ![groot](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/groot/32/13081_2.png) [@groot](https://discourse.julialang.org/u/groot)\
**Post date:** [September 9, 2020, 7:25am UTC](https://discourse.julialang.org/t/please-bring-workspace-or-an-equivalent-back/27948/7 "2020-09-09T07:25:35Z")

</div>

Please advocate for adding this much-wanted feature. Without such a function, it is almost impossible to keep using a session for a long time.
