Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copy Paste Not Working #55303

Closed
Vermasiddhant89 opened this issue Jul 28, 2018 · 50 comments
Closed

Copy Paste Not Working #55303

Vermasiddhant89 opened this issue Jul 28, 2018 · 50 comments
Assignees
Labels
editor-clipboard Editor clipboard issues info-needed Issue requires more information from poster

Comments

@Vermasiddhant89
Copy link

Vermasiddhant89 commented Jul 28, 2018

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

@vscodebot
Copy link

vscodebot bot commented Jul 28, 2018

(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

@vscodebot vscodebot bot added editor editor-clipboard Editor clipboard issues labels Jul 28, 2018
@kieferrm kieferrm removed the editor-clipboard Editor clipboard issues label Jul 30, 2018
@kieferrm
Copy link
Member

/needsMoreInfo

@kieferrm kieferrm self-assigned this Jul 30, 2018
@vscodebot vscodebot bot added the info-needed Issue requires more information from poster label Jul 30, 2018
@vscodebot
Copy link

vscodebot bot commented Jul 30, 2018

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!

@brendanluna
Copy link

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.

@ecbrodie
Copy link

ecbrodie commented Aug 9, 2018

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.

@andyg303
Copy link

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.

@Vermasiddhant89
Copy link
Author

Vermasiddhant89 commented Sep 3, 2018 via email

@alexdima alexdima added editor-clipboard Editor clipboard issues and removed editor labels Sep 20, 2018
@NarniaT
Copy link

NarniaT commented Nov 11, 2018

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

@koliyo
Copy link

koliyo commented Nov 27, 2018

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.

@zheeeng
Copy link

zheeeng commented Dec 15, 2018

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

@bejota
Copy link

bejota commented Jan 9, 2019

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.

@kanstantsin-chernik
Copy link

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

@jdmr
Copy link

jdmr commented Feb 8, 2019

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)

@leopoldkristjansson
Copy link

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.

@kushalj
Copy link

kushalj commented Feb 15, 2019

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.

@Xmetalfanx
Copy link

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

@Xmetalfanx
Copy link

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

@Xmetalfanx
Copy link

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

@dungle-scrubs
Copy link

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.

@bug-z
Copy link

bug-z commented Mar 5, 2019

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

@gongjiaji
Copy link

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.
对于中文用户并且使用了欧陆词典自动取词功能的, 他这个功能的本质是复制粘贴, 最好把软件关掉再做尝试.

@bejota
Copy link

bejota commented Mar 20, 2019

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.

@tim-rohrer
Copy link

tim-rohrer commented Apr 8, 2019

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.

@p0fi
Copy link

p0fi commented Apr 8, 2019

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 😱

@bug-z
Copy link

bug-z commented Apr 9, 2019

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.

@p0fi
Copy link

p0fi commented Apr 9, 2019

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 🤷‍♂️

@tim-rohrer
Copy link

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

Where did you find keybinding.json?

@p0fi
Copy link

p0fi commented Apr 9, 2019

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

@tim-rohrer
Copy link

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.

@WillLuce
Copy link

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"
	}

@caseyjconger
Copy link

Bless your soul @p0fi

@gcacars
Copy link

gcacars commented May 11, 2019

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

@MelMacaluso
Copy link

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

@Xmetalfanx
Copy link

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

@nakedfool
Copy link

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?

@jreljac
Copy link

jreljac commented Oct 16, 2019

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

@RhetTbull
Copy link

RhetTbull commented Mar 14, 2020

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.

@xinzweb
Copy link

xinzweb commented Apr 15, 2020

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

@domingogogo
Copy link

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

@adnanhz
Copy link

adnanhz commented Apr 24, 2020

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

@xinzweb
Copy link

xinzweb commented Apr 24, 2020

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)

@sageetheba
Copy link

sageetheba commented Apr 30, 2020

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.

@CocoTheCoder
Copy link

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.

@mitchdubdub
Copy link

looks like this issue VSCodeVim/Vim#4149 was re-introduced into the current

@tobiashochguertel
Copy link

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..).

@cnjdk
Copy link

cnjdk commented May 18, 2020

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.

@totszwai
Copy link

totszwai commented Jul 23, 2020

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: 8c426f9
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

@rochelryu
Copy link

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........

@github-actions github-actions bot locked and limited conversation to collaborators Dec 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
editor-clipboard Editor clipboard issues info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests