# Julia REPL Keybindings, Shortcut Keys Clarification

**URL:** https://discourse.julialang.org/t/julia-repl-keybindings-shortcut-keys-clarification/52627
**Category:** New to Julia
**Created:** [December 30, 2020, 7:16pm UTC](https://discourse.julialang.org/t/julia-repl-keybindings-shortcut-keys-clarification/52627 "2020-12-30T19:16:21Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![jasonhnicholson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jasonhnicholson/32/20554_2.png) [@jasonhnicholson](https://discourse.julialang.org/u/jasonhnicholson)
#### Post date: [December 30, 2020, 7:16pm UTC](https://discourse.julialang.org/t/julia-repl-keybindings-shortcut-keys-clarification/52627/1 "2020-12-30T19:16:21Z")

</div>

I am trying to understand all the standard [keybindings in the Julia REPL](https://docs.julialang.org/en/v1/stdlib/REPL/#Key-bindings). There are some keys I don’t understand and I don’t understand what to search to understand them.

# What I do know

If any of this is incorrect, please correct it.

- ^ is Ctrl
- meta- is Alt on WIndows, Alt/Option on Mac, Alt on Linux
- meta-\< is actually meta+shift+\<. The shift is implied (this is weird because it isn’t implied with other key bindings. for example ^K is Ctrl+k and not Ctrl+Shift+K).

# What I don’t know

1. I can’t seem to make this following work in Julia REPL in Window Terminal or VS Code Terminal.

- `^-Space` Set the “mark” in the editing region (and de-activate the region if it’s active)
- `^-Space ^-Space` Set the “mark” in the editing region and make the region “active”, i.e. highlighted

1. What is the kill ring? How do I work with it?

- `meta-w` Copy the current region in the kill ring
- `meta-W` “Kill” the current region, placing the text in the kill ring
- `^K` “Kill” to end of line, placing the text in the kill ring
- `^Y` “Yank” insert the text from the kill ring
- `meta-y` Replace a previously yanked text with an older entry from the kill ring

---

<div class="post-metadata">

### Author: ![ffevotte](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ffevotte/32/6587_2.png) [@ffevotte](https://discourse.julialang.org/u/ffevotte)
#### Post date: [December 30, 2020, 9:08pm UTC](https://discourse.julialang.org/t/julia-repl-keybindings-shortcut-keys-clarification/52627/2 "2020-12-30T21:08:00Z")

</div>

_A bit of history:_

AFAICS, a lot of these concepts and terminology have been introduced by software from the GNU project (such as [Emacs](https://en.wikipedia.org/wiki/Emacs) or [Readline](https://en.wikipedia.org/wiki/GNU_Readline)) very early, back when terms like “copy” or “paste” did not really exist, and keyboards were not standardized like they are today.

Although [CUA](https://en.wikipedia.org/wiki/IBM_Common_User_Access) is probably nowadays the major source of inspiration for most user interface designs (especially key bindings in GUIs), such Emacs-based key-bindings remain widely used in a lot of terminal-based UIs.

All this (not so interesting) discussion to get to one (potentially interesting) point: you might be able to find more detailed information about all this in any source of documentation related to Emacs.

> [@jasonhnicholson](#):
>
> If any of this is incorrect, please correct it.
> 
> - ^ is Ctrl
> - meta- is Alt on WIndows, Alt/Option on Mac, Alt on Linux

All this looks correct. As you know, a binding like `meta-w` will be triggered when pressing simultaneously the Alt and w keys. But note that it should also be triggered when pressing Esc _followed by_ w.

> [@jasonhnicholson](#):
>
> - meta-\< is actually meta+shift+\<. The shift is implied (this is weird because it isn’t implied with other key bindings. for example ^K is Ctrl+k and not Ctrl+Shift+K).

`meta-<` should mean Alt (or Option) in conjunction with whatever key-chord produces the less-than symbol (`<`). With an English [QWERTY](https://en.wikipedia.org/wiki/QWERTY) keyboard layout, this might be Alt+Shift+, (therefore the implied Shift key). But on my French [AZERTY](https://en.wikipedia.org/wiki/AZERTY) layout, this is simply Alt+\<.

You’re right that there is some inconsistency in the way letter keys are denoted. Extracting some examples from the [list](https://docs.julialang.org/en/v1/stdlib/REPL/#Key-bindings) you already mentioned:

- `meta-w` refers to Alt+w
- `meta-W` refers to Alt+Shift+w (implied Shift in order to get the upper-case `W`)
- `meta-F`: this should probably rather be `meta-f` because it refers to Alt+f

I think bindings such as `^C` or `^K` always refer to Ctrl+letter without any implied Shift.  
I might be wrong, but I don’t think there are any bindings with Ctrl+Shift+something (and if there were, it would probably be denoted differently).

> [@jasonhnicholson](#):
>
> 1. I can’t seem to make this following work in Julia REPL in Window Terminal or VS Code Terminal.
> - `^-Space` Set the “mark” in the editing region (and de-activate the region if it’s active)
> - `^-Space ^-Space` Set the “mark” in the editing region and make the region “active”, i.e. highlighted

The “region” is the part of text between the “mark” and the “point”. The “point” is the current position of the cursor; the mark is a position that you set beforehand using this `^-Space` key binding. When the region is “active”, the text in it is highlighted, which makes it easier to visually follow what you’re doing. (But even when the region is not active, you can still use all commands which work on the region, like “killing” / “yanking”)

> [@jasonhnicholson](#):
>
> 1. What is the kill ring? How do I work with it?
> - `meta-w` Copy the current region in the kill ring
> - `meta-W` “Kill” the current region, placing the text in the kill ring
> - `^K` “Kill” to end of line, placing the text in the kill ring
> - `^Y` “Yank” insert the text from the kill ring
> - `meta-y` Replace a previously yanked text with an older entry from the kill ring

In short,

- the “kill ring” is like the “clipboard” in the terminology you’re probably used to (except that it can store several things, more on that below)
- “killing” is like “cutting” (i.e. delete some text but save it in the “kill ring”/“clipboard”)
- “yanking” is like “pasting” (retrieve some text from the “kill ring”/“clipboard” and insert it)

So Copy/Kill/Yank is more or less like Copy/Cut/Paste. It operates on the current region, as defined by the previously set “mark” and the current “point”. (And keep in mind that it operates whether the region is active or not).  
`^K` is a specific “kill” operation which does not operate on the region, but rather “kills” all the text from the “point” to the end of the current line.

A difference between the “kill ring” and the clipboard is that the kill ring saves several entries. When you yank something using `^Y`, you retrieve by default the last killed text. But if you want to retrieve some older entry instead, you can then press `meta-y` to yank the second-to-last entry instead. And additional `meta-y` yank increasingly older entries from the kill-ring, until you get to the one you want and resume normal editing (by pressing anything other than `meta-y`).

---

<div class="post-metadata">

### Author: ![ffevotte](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ffevotte/32/6587_2.png) [@ffevotte](https://discourse.julialang.org/u/ffevotte)
#### Post date: [December 30, 2020, 9:13pm UTC](https://discourse.julialang.org/t/julia-repl-keybindings-shortcut-keys-clarification/52627/3 "2020-12-30T21:13:24Z")

</div>

> [@jasonhnicholson](#):
>
> I can’t seem to make this following work in Julia REPL in Window Terminal or VS Code Terminal.

One last thing to keep in mind: the terminal itself (Windows Terminal or VS Code) might very well choose to react to any binding (doing whatever it wants) instead of forwarding it to the Julia REPL running inside it. I don’t use VS Code to much, but I think this happens at least for `^K`, which has a default meaning in VS code.

---

<div class="post-metadata">

### Author: ![jasonhnicholson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jasonhnicholson/32/20554_2.png) [@jasonhnicholson](https://discourse.julialang.org/u/jasonhnicholson)
#### Post date: [December 31, 2020, 8:35pm UTC](https://discourse.julialang.org/t/julia-repl-keybindings-shortcut-keys-clarification/52627/4 "2020-12-31T20:35:34Z")

</div>

@ffevotte, thank you for your reply! I learned about emacs keybindings and markdown `<kbd>` tags. Thank you!

---

<div class="post-metadata">

### Author: ![fph](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fph/32/17159_2.png) [@fph](https://discourse.julialang.org/u/fph)
#### Post date: [January 1, 2021, 9:53am UTC](https://discourse.julialang.org/t/julia-repl-keybindings-shortcut-keys-clarification/52627/5 "2021-01-01T09:53:22Z")

</div>

Another thing that should be told new users, in my view, is that **pressing CTRL+S blocks all output in the REPL until you press CTRL+Q**. This is deeply counterintuitive, and typing CTRL+S to save a file is something that may be deep ingrained in muscle memory.

---

<div class="post-metadata">

### Author: ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)
#### Post date: [January 1, 2021, 12:16pm UTC](https://discourse.julialang.org/t/julia-repl-keybindings-shortcut-keys-clarification/52627/6 "2021-01-01T12:16:18Z")

</div>

> [@fph](#):
>
> Another thing that should be told new users, in my view, is that **pressing CTRL+S blocks all output in the REPL until you press CTRL+Q**.

I am not sure it’s the Julia REPL doing that — it may just be [terminal flow control](https://retrocomputing.stackexchange.com/questions/7263/history-of-ctrl-s-and-ctrl-q-for-flow-control). Most terminal emulators allow you do disable it.

---

<div class="post-metadata">

### Author: ![jdad](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jdad/32/4739_2.png) [@jdad](https://discourse.julialang.org/u/jdad)
#### Post date: [January 1, 2021, 12:54pm UTC](https://discourse.julialang.org/t/julia-repl-keybindings-shortcut-keys-clarification/52627/7 "2021-01-01T12:54:00Z")

</div>

Yes this is is unix thing (terminal discipline), see man stty on linux. ^S stands for “Stop output” (from scrolling through the terminal) and ^Q for “Qlear the stopping output”( resume sprinting and scrolling). On Windows I am not sure where/how it is implemented, in mintty most surely, in WindowsTerminal have to check?

---

<div class="post-metadata">

### Author: ![fph](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fph/32/17159_2.png) [@fph](https://discourse.julialang.org/u/fph)
#### Post date: [January 1, 2021, 1:27pm UTC](https://discourse.julialang.org/t/julia-repl-keybindings-shortcut-keys-clarification/52627/8 "2021-01-01T13:27:06Z")

</div>

> [@Tamas\_Papp](#):
>
> I am not sure it’s the Julia REPL doing that — it may just be [terminal flow control](https://retrocomputing.stackexchange.com/questions/7263/history-of-ctrl-s-and-ctrl-q-for-flow-control). Most terminal emulators allow you do disable it.

Well, it happens in Juno on my machine (JuliaPro on Ubuntu), at least. I am not sure which part of the software stack is responsible for that, but does it matter? It is information that may trip up a new user, because it conflicts with a commonly-used CUA shortcut, and personally I think it should be documented.
