# Usability tweak for Pkg

**URL:** <https://discourse.julialang.org/t/usability-tweak-for-pkg/17203>\
**Category:** General Usage\
**Tags:** proposal\
**Created:** [November 6, 2018, 7:55am UTC](https://discourse.julialang.org/t/usability-tweak-for-pkg/17203 "2018-11-06T07:55:50Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![gdkrmr](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gdkrmr/32/2791_2.png) [@gdkrmr](https://discourse.julialang.org/u/gdkrmr)\
**Post date:** [November 6, 2018, 7:55am UTC](https://discourse.julialang.org/t/usability-tweak-for-pkg/17203/1 "2018-11-06T07:55:50Z")

</div>

I find myself very often doing something like this:

```julia
(v1.0) pkg> up
  Updating ........................

(v1.0) pkg> using MyPkg
ERROR: expected command. instead got [using]

```

I propose that `using` (and possibly some other keywords) switch back to the `julia>` prompt before executing.

---

<div class="post-metadata">

**Author:** ![mauro3](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mauro3/32/292_2.png) [@mauro3](https://discourse.julialang.org/u/mauro3)\
**Post date:** [November 6, 2018, 8:48am UTC](https://discourse.julialang.org/t/usability-tweak-for-pkg/17203/2 "2018-11-06T08:48:21Z")

</div>

I think this is too much DWIM.

(Tangentially related: [https://github.com/JuliaLang/julia/issues/27555](https://github.com/JuliaLang/julia/issues/27555) )

---

<div class="post-metadata">

**Author:** ![carstenbauer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/carstenbauer/32/4981_2.png) [@carstenbauer](https://discourse.julialang.org/u/carstenbauer)\
**Post date:** [November 6, 2018, 9:03am UTC](https://discourse.julialang.org/t/usability-tweak-for-pkg/17203/3 "2018-11-06T09:03:37Z")

</div>

I guess @mauro3 is right.

But I also walked into this trap a couple of times. In my case I (mis)use `using SomePackage` to precompile a particular package, a functionality that the `pkg` REPL mode should probably have. However, there is only `precompile` which precompiles all packages. Since we are about to have [`status SomePackage`](https://github.com/JuliaLang/Pkg.jl/pull/881) maybe we should also add `precompile SomePackage`.

UPDATE: See [https://github.com/JuliaLang/Pkg.jl/issues/888](https://github.com/JuliaLang/Pkg.jl/issues/888)

---

<div class="post-metadata">

**Author:** ![crbinz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/crbinz/32/1919_2.png) [@crbinz](https://discourse.julialang.org/u/crbinz)\
**Post date:** [November 6, 2018, 1:35pm UTC](https://discourse.julialang.org/t/usability-tweak-for-pkg/17203/4 "2018-11-06T13:35:03Z")

</div>

I do this constantly. I think maybe that switching back to the `julia>` prompt _but not executing_ might be a good idea.

```julia
(v1.0) pkg> using MyPkg

julia> using MyPkg

```

That way the user can just hit `Enter` one more time to do what s/he meant, and it avoids behavior that might be surprising to some.

---

<div class="post-metadata">

**Author:** ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)\
**Post date:** [November 6, 2018, 1:46pm UTC](https://discourse.julialang.org/t/usability-tweak-for-pkg/17203/5 "2018-11-06T13:46:26Z")

</div>

I find myself doing this a lot too but I have a different solution in mind for the issue: when someone does `using X` in an interactive environment and `X` has not been added, prompt them interactively if they want to add `X` (and if there is more than one thing named `X` which one they want).

---

<div class="post-metadata">

**Author:** ![y4lu](https://avatars.discourse-cdn.com/v4/letter/y/47e85d/32.png) [@y4lu](https://discourse.julialang.org/u/y4lu)\
**Post date:** [November 6, 2018, 1:54pm UTC](https://discourse.julialang.org/t/usability-tweak-for-pkg/17203/6 "2018-11-06T13:54:07Z")

</div>

Command completion in the repl switches automagically

```julia
 julia> activ [up key]
pkg> usin [up key] 
julia>
```

---

<div class="post-metadata">

**Author:** ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)\
**Post date:** [November 6, 2018, 2:14pm UTC](https://discourse.julialang.org/t/usability-tweak-for-pkg/17203/7 "2018-11-06T14:14:26Z")

</div>

It’s not “automagic”: history includes what mode each command was entered in. If you had entered `julia> activate(something)` most recently then that’s what you’d get.
