# Allow escape key to leave shell or pkg mode

**URL:** <https://discourse.julialang.org/t/allow-escape-key-to-leave-shell-or-pkg-mode/23802>\
**Category:** Internals & Design\
**Created:** [May 3, 2019, 5:41am UTC](https://discourse.julialang.org/t/allow-escape-key-to-leave-shell-or-pkg-mode/23802 "2019-05-03T05:41:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tlienart](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tlienart/32/7640_2.png) [@tlienart](https://discourse.julialang.org/u/tlienart)\
**Post date:** [May 3, 2019, 5:41am UTC](https://discourse.julialang.org/t/allow-escape-key-to-leave-shell-or-pkg-mode/23802/1 "2019-05-03T05:41:14Z")

</div>

It’s maybe just me who’d like to see this but I sometimes find myself writing julia commands in pkg or shell mode and wished there was a more direct way to switch to the correct mode than go to the start of the line and press backspace.

Would it be possible to map a key such as the ESC key for the same effect (i.e. you could press it at any time in `shell>` or `pkg>` mode and it would go to `julia>` mode?

```julia
pkg> println( # press [ESC] after realising I'm still in pkg>
# changes to
julia> println( # now I can complete the command and run it

```

---

<div class="post-metadata">

**Author:** ![BeastyBlacksmith](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/beastyblacksmith/32/4741_2.png) [@BeastyBlacksmith](https://discourse.julialang.org/u/BeastyBlacksmith)\
**Post date:** [May 3, 2019, 10:09am UTC](https://discourse.julialang.org/t/allow-escape-key-to-leave-shell-or-pkg-mode/23802/2 "2019-05-03T10:09:25Z")

</div>

That plus be able to toggle persistent and one time custom shell mode ( currently `pkg>` is permanent but most other not).  
I am thinking of something like press mode character once to get single execution mode and press meta+mode character to get persistent mode, where meta is maybe `Ctrl` or `Alt`.

---

<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:** [May 3, 2019, 11:22am UTC](https://discourse.julialang.org/t/allow-escape-key-to-leave-shell-or-pkg-mode/23802/3 "2019-05-03T11:22:07Z")

</div>

Seems like a good idea. Would you mind opening a feature request issue?

---

<div class="post-metadata">

**Author:** ![BeastyBlacksmith](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/beastyblacksmith/32/4741_2.png) [@BeastyBlacksmith](https://discourse.julialang.org/u/BeastyBlacksmith)\
**Post date:** [May 3, 2019, 12:14pm UTC](https://discourse.julialang.org/t/allow-escape-key-to-leave-shell-or-pkg-mode/23802/4 "2019-05-03T12:14:37Z")

</div>

[https://github.com/JuliaLang/julia/issues/31910](https://github.com/JuliaLang/julia/issues/31910)
