Vscode: Copy Paste Not Working

Created on 28 Jul 2018  ·  50Comments  ·  Source: microsoft/vscode

Unable to copy and paste the on the same file, I am using Window 10 and 1.25.1 version of visual studio.

editor-clipboard needs more info

Most helpful comment

I had the same issue by the sounds of things. I could not copy / paste into or out of VS Code. (C&P internally was OK though).

For some reason doing the following fixed it on Mac:

  • Go to /Users/YOUR_USER_NAME/Library/Application Support/Code/CachedData
  • Delete all files, then restart VS Code.

Hope that helps others fix and/or helps root out the underlying cause.

All 50 comments

/needsMoreInfo

Thanks for creating this issue! We figured it's missing some basic information or in some other way doesn't follow our issue reporting guidelines. Please take the time to review these and update the issue.

Happy Coding!

Also experiencing this all of a sudden. On Version 1.21.1 of VSCode using Mac OS High Sierra 10.13.6. Only started happening within the last few days.

A full close of VSCode doesn't seem to fix it either, and I've tried disabling all related copy and paste extensions (I use Clipboard History and Paste with Indent).

I've also been experiencing some issues with saving files immediately. I'll do cmd+s to save a file, and it seems to hang for a second or two before saving whereas prior the file would save immediately.

I am also experiencing this issue too. This time, it is more like I cannot copy ANYTHING from VS Code into my system clipboard. I am using VSCode 1.25.1 and MacOS 10.13.6. It also looks like an intermittent issue. Closing and reopening VSCode was enough for the issue to go away.

I was testing the reproduction by trying to copy text from VSCode and paste it into the address bar in Chrome.

I had the same issue by the sounds of things. I could not copy / paste into or out of VS Code. (C&P internally was OK though).

For some reason doing the following fixed it on Mac:

  • Go to /Users/YOUR_USER_NAME/Library/Application Support/Code/CachedData
  • Delete all files, then restart VS Code.

Hope that helps others fix and/or helps root out the underlying cause.

Hi There,

I have uninstall the VS code and restart the machine and again install the
updated version 1.26.1 ,

Now it is working fine on copy/paste the code.

You can also clear the cache before uninstalling .

Below are manual method to clear the cache from the machine.

Windows: C:\Users\\AppData\Roaming\Code\Local Storage

Linux: /home//.config/Code/Local Storage

macOS: /Users//Library/Application Support/Code/Local Storage

Thanks and Regards

Siddhant

On Thu, Aug 30, 2018 at 3:58 PM andyg303 notifications@github.com wrote:

I had the same issue by the sounds of things. I could not copy / paste
into or out of VS Code. (C&P internally was OK though).

For some reason doing the following fixed it on Mac:

  • Go to /Users/YOUR_USER_NAME/Library/Application
    Support/Code/CachedData
  • Delete all files, then restart VS Code.

Hope that helps others fix and/or helps root out the underlying cause.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/Microsoft/vscode/issues/55303#issuecomment-417271045,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AmZC7dDgSkeMpcJwyOkvfL5kn_zQ4SK3ks5uV75GgaJpZM4VlFPB
.

same issue here. Also updated my vscode and not fixed.

UPDATE
This was somehow resolved by restarting my machine. Now it works, even after restoring the old VS Code configuration.


I have the same problem in 1.29.1, on Mac

I have deleted all the vs code settings

  • ~/.vscode
  • ~/Library/Application Support/Code

And restarted VS Code.

But still can not access the global Mac clipboard.

I have not had this problem before.

I encountered this issue just then and restarting my machine(mac os 10.11.6) resolved it

On Linux (CentOS 7.2), deleting the contents of '/home//.config/Code/Local Storage' worked the first time. Next occurrence, I had to delete the contents then reboot.
It's happened again and the cause seems to be my attempt to paste from a PuTTY terminal into VS Code. VS Code hangs then a popup dialog asks to wait or kill. I am connecting remotely to the Linux server via PuTTY from Windows.

The same problem, RHEL 6.1. For some reason clipboard stops working.

Unfortunately I have the same problem. Upgraded to 1.31.0 and the paste on the explorer stopped working. I've restarted, removed the cache, even uninstalled/installed vscode and still can't get it to work.

I've got macos mojave 10.14.2... Hopefully I can get this fixed before I have to reinstall my computer (VS Code is that important! Thanks for all the hard work)

Had a copy paste problem now for months/maybe a year on my Windows machine. Restarting VS Code fixes it but it keeps popping up.

CMD-v paste was dying once a week but now dying every hour after Version 1.31.1 update. Quit and restart fixes it. But it's really a fix. How is this still a problem. It's been an issue on and off for well over a year.

I was just here troubleshooting a paste related issue and i found something that may be affecting others ... hoping a dev see's this as it may be related to an addon and not something (or maybe it is in vscode by default ... who knows)

anyway, I looked through my extensions and searched for "paste" ... I disabled _paste JSON as code_ (100% added by me) and _indent on paste_ (that is the one I am not sure if say _awesome-vscode_ added that one or if intend on paste is there in a default install ... anyway I did not remove that one i just disabled it .. paste is working again ... don't think i have any "paste" items in preferences changed from default settings ...

Hoping this may help others and devs, when people ask about a similar "paste, is not working" issue

not 100% sure but i think this is the one i mean .. dont see why it wouldn't be (aka two ext. with the same name and there is another one) https://marketplace.visualstudio.com/items?itemName=gazugafan.vscode-indent-on-paste

sorry for "post spamming" but i saw https://github.com/gazugafan/vscode-indent-on-paste/issues/3 ... the dev is aware it seems

This has been an issue for me also, for well over a year. I've tried everything from restarting VSC, testing extensions one-by-one, reformatting my Mac.

It typically happens a few times a day and I have to restart the workspace, but not the full app. I can leave other projects open and only re-open the current one.

I've noticed that it specifically happens after copying something in an HTML file, usually a class for some reason.

When this happens, tab, paste, and all intellisense stops working.

sorry for "post spamming" but i saw gazugafan/vscode-indent-on-paste#3 ... the dev is aware it seems

I tried to use it, but to no success - paste stops working the same with or without this extension

well, I am pretty sure the problem is some "copy-paste" extensions on my MacBook. The function works as expected right after I shut the extension down.
对于中文用户并且使用了欧陆词典自动取词功能的, 他这个功能的本质是复制粘贴, 最好把软件关掉再做尝试.

Building on previous comment, I'm using x2go to open a terminal on the remote linux box.
Observations:

  • I noticed that pasting into the x2go terminal was failing also. Restarting x2go & VS Code recovered paste functionality to both programs.
  • Selecting any text in VS Code, then attempting to paste elsewhere in the editor always caused it to hang.

Potential solution (not sure if all, one or combination):

  • I've disabled the following settings: Selection Clipboard, Drag And Drop, Copy On Selection

Still a bit quirky but clipboard and copy/paste are working as expected.

Mojave 10.14
VSCode 1.33.0

I disabled all extensions, deleted cache and restarted the computer. Logged back in and did a copy & paster in Notes. No problem. Pasted the same contents into a VSCode document. Worked.

Then tried copying something from the VSCode document, and pasting it. No go.

Interestingly, ctrl-click, then copy does work. Also, going into the command palette and selecting copy seems to work. Only the shortcut cmd-c seems to be affected. I tried reassigning the shortcut (which is also used by seven other commands according to VSCode, but that didn't seem to help.

Another workaround I discovered that works is to select the text I want in VSCode, cmd-x and immediately cmd-v to paste it back. Then I can past the text elsewhere. Quite a pain.

I have the same problem since a couple of days,… what the heck?
Does anybody have a solution? No copy / past makes vscode basically unusable 😱

I have the same problem since a couple of days,… what the heck?
Does anybody have a solution? No copy / past makes vscode basically unusable scream

You've also disabled all extensions? I had just the same issue and disabled all extensions and it started working again... Though couldn't definitely find the extension causing the issue... Seems it is some roaming error.

I found the Issue!
For whatever reason I had a key chord defined where cmd+c was the starter. I noticed this after I saw in the status bar that it said: cmd+c was pressed. Waiting for second key of chord I could not find this chord in the Keyboard Shortcuts section of vscode when I searched for cmd+c since this search does not include chords containing the search query. I needed to look in the keybinding.json and found it there via cmd+f (find).

I removed this keybinding and now everything works again! 🎉

After all I have no idea how I might have set this binding 🤷‍♂️

I needed to look in the keybinding.json and found it there via cmd+f (find).

Where did you find keybinding.json?

VSCode opens the file in an editor when you press there:
2019-04-09 at 16 36

I found the Issue!
For whatever reason I had a key chord defined where cmd+c was the starter. I noticed this after I saw in the status bar that it said: cmd+c was pressed. Waiting for second key of chord I could not find this chord in the Keyboard Shortcuts section of vscode when I searched for cmd+c since this search does not include chords containing the search query. I needed to look in the keybinding.json and found it there via cmd+f (find).

I removed this keybinding and now everything works again! 🎉

After all I have no idea how I might have set this binding 🤷‍♂️

I found mine! Self-inflicted!!!

Problem solved.

I found the Issue!
For whatever reason I had a key chord defined where cmd+c was the starter. I noticed this after I saw in the status bar that it said: cmd+c was pressed. Waiting for second key of chord I could not find this chord in the Keyboard Shortcuts section of vscode when I searched for cmd+c since this search does not include chords containing the search query. I needed to look in the keybinding.json and found it there via cmd+f (find).

I removed this keybinding and now everything works again! 🎉

After all I have no idea how I might have set this binding 🤷‍♂️

This worked for me as well. I removed this setting in my keybindings.json

    {
        "key": "cmd+c cmd+a",
        "command": "search.action.collapseSearchResults"
    }

Bless your soul @p0fi

For me too. But the problem is not the keybinds, by context menu command I have the same problem.

I had the same issue by the sounds of things. I could not copy / paste into or out of VS Code. (C&P internally was OK though).

For some reason doing the following fixed it on Mac:

  • Go to /Users/YOUR_USER_NAME/Library/Application Support/Code/CachedData
  • Delete all files, then restart VS Code.

Hope that helps others fix and/or helps root out the underlying cause.

This fixed it, cheers

It's been a while for me and I use vscode on different distro bases (not Windows) of Linux ... Arch, Fedora, OpenSuse, and Ubuntu bases ... with the past few versions and no fixes (if i posted that above) needed ... I have NOT run into this issue, myself

I still have this issue on Windows 10.
So far i tried :

  • Disabling and enabling extensions
  • Restarting VS Code and restarting PC
  • Uninstalling and installing again VS code
  • Not running it with ".code"

None of this helped, anyone can help?

This is happening to me as well

My setup

macOS 10.14.6
VSCode 1.39.2
Alfred 4.0.5 (with clipboard history turned on)

I'll be fine then randomly cmd+v stops pasting after cmd+c

If I cmd+v and it breaks I look at my Alfred paste history what I was pasting over is listed first and what I had previously copied was listed second. Seems like VS Code is now treating cmd+v as cmd+c.

Turning off Alfred does nothing.
Restarting VSCode tends to help.

My installed and active extensions are:

  • alefragnani.project-manager
  • be5invis.vscode-icontheme-nomo-dark
  • bmewburn.vscode-intelephense-client
  • formulahendry.auto-close-tag
  • johnpapa.vscode-peacock
  • oderwat.indent-rainbow
  • Shan.code-settings-sync
  • streetsidesoftware.code-spell-checker
  • JasonReljac.theme-coda

I have this problem as well:
VS Code Version: 1.42.1

MacOS 10.15.1

Installed extensions:

  • Cameron.vscode-pytest
  • DotJoshJohnson.xml
  • Gruntfuggly.todo-tree
  • ms-python.python
  • tommorris.mako
  • Tyriar.sort-lines
  • vscodevim.vim

I have no keybindings set in keybindings.json

I've cleared the cache ( /Users/YOUR_USER_NAME/Library/Application Support/Code/CachedData) and restarted VS Code as others have suggested but that doesn't solve the problem. Cmd-C works in every other app.

Similar issue:

VS Code Version: 1.44.1

MacOS 10.15.4

Installed Extensions:

  • C/C++ 0.27.0
  • GitLens 10.2.1
  • Go 0.13.1
  • Live Share 1.0.1947
  • Python 2020.3.71659
  • Vim 1.13.1 (I used it to work around the issue within the editor)
  • YAML 0.7.2

in the version 1.44.0 of VSCode IDE, when I use copy and paste, multiple repeats it. the VSCode will break it down and popup let me reopen. pls refix it. thanks

I'm having the same problem on Windows 10.
Copying works fine.
Pasting works fine until it stops working suddenly.
Then I copy from VSCode and have notepad++ open for the sole purpose of pasting.

image

Similar issue:

VS Code Version: 1.44.1

MacOS 10.15.4

Installed Extensions:

  • C/C++ 0.27.0
  • GitLens 10.2.1
  • Go 0.13.1
  • Live Share 1.0.1947
  • Python 2020.3.71659
  • Vim 1.13.1 (I used it to work around the issue within the editor)
  • YAML 0.7.2
    (updated)
    The copy-paste issue is not related to cask install or directly download and install. I experience the same problem, and also has the fix:

Repro

  • brew cask install visual-studio-code
  • then just from the terminal run code . to open your project
  • the copy-paste doesn't work.

Fix

  • instead of using code . to open the code first time, directly click the Visual Studio Code from the Applications
  • MacOs Catalina security protection will prompt you whether you want to trust the application. Click on open.
  • then using the same application, you can use code . to open new project in that running instance, the copy-paste will work.
  • again, if you directly use the code . to start the first instance, then the copy-paste doesn't work. (There has to be some permission related stuff on how the instance got started)

I have same issue but if we use "Ctrl"+"Shift"+V ...it will work in visual studio code

if You installed "VIM" extension in Your VS Code then UnInstalled it .
its work for me.

I have same issue but if we use "Ctrl"+"Shift"+V ...it will work in visual studio code

if You installed "VIM" extension in Your VS Code then UnInstalled it .
its work for me.

Yup yup. This is the same issue I have had and how I had to resolve it. It only happens on Windows for me. In order to use copy + paste, I have to be in vim's insert mode.

looks like this issue https://github.com/VSCodeVim/Vim/issues/4149 was re-introduced into the current

It looks fot me that VSCode does not share the same clipboard like mac Os. because I can copy and paste inside of VSCode, but I can't paste content which copied from outside of VSCode (Opera Touch, Sublime Text and so on..).

After fighting VSCODE 1.45.1 on Windows 10 with PHP code with Unix LF and UTF8 encoding for days, I was able to replicate this problem in Notepad++ with VSCode closed. Seems that it has to do with encoding of white space when you copy-paste into another editor and then back. I was using UTF8 but when I changed the code to ANSI, weird white space characters showed up. After I deleted them and changed the encoding back to UTF8 everything worked fine.

Happening with the latest.
Cannot copy paste from the explorer panel.
Was working before. It just greyed out.

Version: 1.48.0-insider (user setup)
Commit: 8c426f9f3b6b18935cc6c2ec8aa6d45ccd88021e
Date: 2020-07-23T05:50:56.947Z
Electron: 9.1.0
Chrome: 83.0.4103.122
Node.js: 12.14.1
V8: 8.3.110.13-electron.0
OS: Windows_NT x64 10.0.18362

image

SAVE ALL PROBLEMS WITH GOD INSTRUCTIONS (god:save, god:...paste, god:....cut, god:...copy)
1 - cmd + Shift + P
2 - search this : >God: Create .editorconfig
3 - Select this.

GOD INSTRUCTIONS is ready........

Hey @kieferrm, this issue might need further attention.

@Vermasiddhant89, you can help us out by closing this issue if the problem no longer exists, or adding more information.

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

Happy Coding!

Was this page helpful?
0 / 5 - 0 ratings