# Copy / paste in jupyterlab terminal

**URL:** https://discourse.jupyter.org/t/copy-paste-in-jupyterlab-terminal/2711
**Category:** JupyterLab
**Created:** [November 20, 2019, 1:50pm UTC](https://discourse.jupyter.org/t/copy-paste-in-jupyterlab-terminal/2711 "2019-11-20T13:50:45Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![mvcalder](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/mvcalder/32/337_2.png) [@mvcalder](https://discourse.jupyter.org/u/mvcalder)
#### Post date: [November 20, 2019, 1:50pm UTC](https://discourse.jupyter.org/t/copy-paste-in-jupyterlab-terminal/2711/1 "2019-11-20T13:50:45Z")

</div>

Currently in terminals I can paste using Ctrl-V, but in order to copy I need to use Shift-RightClick and choose the Copy menu item. I would like to be able to either Shift-Ctrl-C or if possible use Ctrl-C and have it do a Copy if text is selected or do an interrupt otherwise. I’ve read this discussion on github, particularly [https://github.com/jupyterlab/jupyterlab/issues/1146#issuecomment-426436903](https://github.com/jupyterlab/jupyterlab/issues/1146#issuecomment-426436903) . But it is not clear to me how to incorporate that into my jupyterlab.

I tried to change the settings for Shift-Ctrl-C as per [https://jupyterlab.readthedocs.io/en/stable/user/terminal.html](https://jupyterlab.readthedocs.io/en/stable/user/terminal.html)  
by putting this in my Settings Keyboard Shortcuts:

```auto
    { "shortcuts": [
    {
            "command": "apputils:activate-command-palette",
            "keys": [
                "Accel Shift Z"
            ],
            "selector": "body"
        }
    ]
}

```

but that didn’t work (the command palette still opens with Shift Ctrl C). Can someone explain how to make Ctrl-C or Shift Ctrl-C copy to the clipboard in a jupyterlab terminal?

Thanks,

Matt

---

<div class="post-metadata">

### Author: ![manics](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/manics/32/85_2.png) [@manics](https://discourse.jupyter.org/u/manics)
#### Post date: [November 20, 2019, 3:24pm UTC](https://discourse.jupyter.org/t/copy-paste-in-jupyterlab-terminal/2711/2 "2019-11-20T15:24:46Z")

</div>

What operating system and browser are you using? The copy/paste keyboard shortcuts seem to depend on your OS.

For me `CMD-c`/`CMD-v` works on OS X, on Linux I need to use something like `CTRL-ins`/`SHIFT-ins`

---

<div class="post-metadata">

### Author: ![jasongrout](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/jasongrout/32/371_2.png) [@jasongrout](https://discourse.jupyter.org/u/jasongrout)
#### Post date: [November 20, 2019, 4:02pm UTC](https://discourse.jupyter.org/t/copy-paste-in-jupyterlab-terminal/2711/3 "2019-11-20T16:02:25Z")

</div>

> [@mvcalder](#):
>
> { “shortcuts”: [{ “command”: “apputils:activate-command-palette”, “keys”: [“Accel Shift Z”], “selector”: “body” } ] }

Use the `disabled` flag to remove a shortcut:

```json
    { "shortcuts": [
    {
            "command": "apputils:activate-command-palette",
            "keys": [
                "Accel Shift Z"
            ],
            "selector": "body",
            "disabled": true
        }
    ]
}

```

---

<div class="post-metadata">

### Author: ![mvcalder](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/mvcalder/32/337_2.png) [@mvcalder](https://discourse.jupyter.org/u/mvcalder)
#### Post date: [November 20, 2019, 5:46pm UTC](https://discourse.jupyter.org/t/copy-paste-in-jupyterlab-terminal/2711/4 "2019-11-20T17:46:31Z")

</div>

Thanks @jasongrout that disabled the command palette. However, Shift-Ctrl-C now opens the web-dev-tools inspector. I am running Chrome in Windows, the jupyterlab terminal is running in Ubuntu if that matters.

Does anyone know how to get past Chrome stealing the shortcut?

---

<div class="post-metadata">

### Author: ![jasongrout](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/jasongrout/32/371_2.png) [@jasongrout](https://discourse.jupyter.org/u/jasongrout)
#### Post date: [November 20, 2019, 6:43pm UTC](https://discourse.jupyter.org/t/copy-paste-in-jupyterlab-terminal/2711/5 "2019-11-20T18:43:02Z")

</div>

My guess is that Chrome’s behavior is the default behavior, activated because nothing else is attached to that keybinding and preventing the Chrome default. I don’t think Chrome is stealing the shortcut.

I’m not sure how to help you beyond what is in the [docs](https://jupyterlab.readthedocs.io/en/stable/user/terminal.html#copy-paste), that the shortcuts for the terminal appear to depend on the host OS.

---

<div class="post-metadata">

### Author: ![mvcalder](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/mvcalder/32/337_2.png) [@mvcalder](https://discourse.jupyter.org/u/mvcalder)
#### Post date: [November 20, 2019, 6:51pm UTC](https://discourse.jupyter.org/t/copy-paste-in-jupyterlab-terminal/2711/6 "2019-11-20T18:51:05Z")

</div>

Do you have any idea how to incorporate the customization of xterm.js hinted at in this issue:

> <https://github.com/jupyterlab/jupyterlab/issues/1146#issuecomment-426436903>
>
> Triage summary: Document the various keyboard shortcut idiosyncracies for cutting/pasting into the terminal.
> Or even better? Implement William's method noted at #1146...

That would let the terminal use Ctrl-C.

---

<div class="post-metadata">

### Author: ![TR\_M](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/tr_m/32/974_2.png) [@TR\_M](https://discourse.jupyter.org/u/TR_M)
#### Post date: [November 28, 2019, 3:13am UTC](https://discourse.jupyter.org/t/copy-paste-in-jupyterlab-terminal/2711/7 "2019-11-28T03:13:05Z")

</div>

You probably don’t want to switch browsers but Firefox works with Ctrl+C / Ctrl+V in Windows and Linux for me.
