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

paste a file with existing file name in vscode cause them to rename instead of replace existing file #127746

Closed
mhamri opened this issue Jul 1, 2021 · 29 comments
Assignees
Labels
file-explorer Explorer widget issues *out-of-scope Posted issue is not in scope of VS Code under-discussion Issue is under discussion for relevance, priority, approach
Milestone

Comments

@mhamri
Copy link

mhamri commented Jul 1, 2021

I am not sure what happened to the replace file dialog, but it's not working when I copy a file from inside the the vscode.

I tried to find a config but google is not giving any good result back. I also asked the question in SO but no one answered it.

when I copy a file to a folder that a file with the same name exist, the new file get renamed instead of showing the replace dialog box.

for example, if I copy a file abc.jpg from one folder into another folder that abc.jpg exist. i will end up with two files that the old one is abc.jpg and new one is abc copy.jpg

it's new feature and wasn't like this before. previousley, if I paste a file into its origin folder it get renamed, but when I copy into another folder, it asked for replacement, but now it's just renaming, even if the source and destination folder is different.

Unfortunately, I can't find any configuration to change it, also keywords such as "copy", "file", "replace" is too generic that I can't find a solution for this problem by just googling it.

enter image description here

@vscodebot
Copy link

vscodebot bot commented Jul 1, 2021

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

@isidorn
Copy link
Contributor

isidorn commented Jul 1, 2021

I believe this was always behaving like this. If you think this was behaving differently before can you please provide the vscode stable version when it was offering to replace.

@isidorn isidorn added file-explorer Explorer widget issues info-needed Issue requires more information from poster labels Jul 1, 2021
@mhamri
Copy link
Author

mhamri commented Jul 1, 2021

this is from SO answer, but I am not sure what version he is using also I faced this dialog box before.

@isidorn
Copy link
Contributor

isidorn commented Jul 1, 2021

That is when you drag and drop from outside of vscode...

@mhamri
Copy link
Author

mhamri commented Jul 1, 2021

I see, can we have that inside the vscode? it's very hard to sync two folders atm with vscode.

since it's already a existing feature, should be easy to choose the behavior by some setting

@isidorn
Copy link
Contributor

isidorn commented Jul 1, 2021

This is a fair request to have that a bit more unified. However nothing we have plans to change -> backlog.
Once we receive more feedback we might jump on this.

@isidorn isidorn added under-discussion Issue is under discussion for relevance, priority, approach and removed info-needed Issue requires more information from poster labels Jul 1, 2021
@isidorn isidorn added this to the Backlog milestone Jul 1, 2021
@isidorn isidorn added the *out-of-scope Posted issue is not in scope of VS Code label Aug 12, 2021
@mhamri
Copy link
Author

mhamri commented Aug 13, 2021

this is a very minimal task to bring a more predictable result to the vscode. please reconsider as it helps alot when moving files from one project to another project

@chandu-007
Copy link

Yes i agree with @mhamri

@JC-LGMS
Copy link

JC-LGMS commented Mar 2, 2022

me too

@mhamri
Copy link
Author

mhamri commented Mar 6, 2022

@chandu-007 @JC-LGMS please like the original thread, if we reach 10 like probably we can reopen it

@muhfiz
Copy link

muhfiz commented May 5, 2022

please consider it

@kbtganesh
Copy link

C'mon man.. You expect us to paste it and manually delete the existing file & rename the pasted file again? At least you should have a setting to choose what to do when pasting the file with same filename.
As a workaround, use windows file explorer to do paste & replace files.

@kbtganesh
Copy link

That is when you drag and drop from outside of vscode...

And what's the reason for having replace at that scenario alone? Don't you think it will be useful if we do the same in vscode itself?

@mhamri
Copy link
Author

mhamri commented Aug 8, 2022

@isidorn this feature request has 10 likes, could we reopen it?

@zhuweiyou
Copy link

I also want to overwrite the confirmation instead of creating a new file.

@b10102016
Copy link

Recently, face this problem too. Please consider to reopen this.

@theiceeman
Copy link

Reopen this issue please. I believe this feature is helpful and very intuitive to how users use the software

@dJani97
Copy link

dJani97 commented Sep 29, 2022

I agree, on any conflict, there should be a popup with overwrite and rename options. The current method of simply pasting a renamed copy is inferior to basically any other IDE.

Someone recommended to just open the explorer and copy-paste files. But it's not so easy. For example, in vscode, I can see which files have changes, so I may want to copy-paste only those files.

@mhamri
Copy link
Author

mhamri commented Oct 7, 2022

look like it is resolved with the latest vscode explorer.incrementalNaming: disabled. please give it a try and update

@theiceeman
Copy link

look like it is resolved with the latest vscode explorer.incrementalNaming: disabled. please give it a try and update

Hi, why does it throw this warning though? Value is not accepted. Valid values: "simple", "smart".(1)

@mhamri
Copy link
Author

mhamri commented Oct 8, 2022

@okorieebube it's a value just added in vscode 1.72.0. please see if your vscode is updated to the latest or not

@mhamri
Copy link
Author

mhamri commented Oct 8, 2022

so I tested it and if you paste a file that another file with the same name exists in the folder it will take one of these action based on your setting

simple -> add -copy to end of the file name
smart -> file name get an incremental number
disabled -> ask to replace the file

@theiceeman
Copy link

so I tested it and if you paste a file that another file with the same name exists in the folder it will take one of these action based on your setting

simple -> add -copy to end of the file name smart -> file name get an incremental number disabled -> ask to replace the file

It works now, Thanks Mhamri.

@chandu-007
Copy link

chandu-007 commented Oct 9, 2022 via email

@tony-sol
Copy link

Well, it seems to me there is no way to paste a file, for example, in same directory - it always shows replace|cancel dialog, but it's kinda obviously to provide rename|replace|cancel choice instead

@anthonyvdotbe
Copy link

Exactly as @tony-sol says. I opened #165217 some time ago (as a feature request, since technically the behavior is correct, but it's really a usability bug).

@tirathsharma098
Copy link

@isidorn
I don't think this is fine to rename the file without even developer or user knowledge that folder is renamed, which will lead us in an errors and bugs, at least @VSCodeTriageBot should show a pop up or dialog box that folder with same name already exists with options like rename, overwrite.

@tirathsharma098
Copy link

@isidorn I don't think this is fine to rename the file without even developer or user knowledge that folder is renamed, which will lead us in an errors and bugs, at least @VSCodeTriageBot should show a pop up or dialog box that folder with same name already exists with options like rename, overwrite.

Please reopen this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
file-explorer Explorer widget issues *out-of-scope Posted issue is not in scope of VS Code under-discussion Issue is under discussion for relevance, priority, approach
Projects
None yet
Development

No branches or pull requests

14 participants