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

Option to disable Undo/Redo for File Operations #117621

Closed
tsiege opened this issue Feb 24, 2021 · 40 comments · Fixed by #140140
Closed

Option to disable Undo/Redo for File Operations #117621

tsiege opened this issue Feb 24, 2021 · 40 comments · Fixed by #140140
Assignees
Labels
feature-request Request for new features or functionality file-explorer Explorer widget issues insiders-released Patch has been released in VS Code Insiders on-testplan undo-redo Issues around undo/redo
Milestone

Comments

@tsiege
Copy link

tsiege commented Feb 24, 2021

Multiple times since the "Undo File Operations" feature has been released, I've experienced accidentally undoing file renames/deletions. This has caused me a lot more trouble than it's worth. I've lost time undoing unknowingly altering my file system and even automatic name changes in other files related to auto renaming. A prompt isn't enough for me. I simply find the feature harmful to my workflows and would like to have the ability to turn it off. I know others have also found it difficult as well

@isidorn isidorn added file-explorer Explorer widget issues undo-redo Issues around undo/redo feature-request Request for new features or functionality labels Feb 25, 2021
@isidorn isidorn added this to the Backlog milestone Feb 25, 2021
@isidorn
Copy link
Contributor

isidorn commented Feb 25, 2021

This is a fair feature request, however we do not have it on our immediate plan. Thus assigning to backlog and we might add this in the future. Thanks

@tsiege
Copy link
Author

tsiege commented Mar 1, 2021

Thanks @isidorn!

@elis
Copy link

elis commented Mar 6, 2021

When navigating between files, and often selecting a file that you just recently did some change to (in the code), and at the same time having some changes made to the files themselves (e.g. copying, renaming, moving files via the file navigator), I often click Undo/Redo EXPECTING my code to update, but sometimes it will have catastrophic consequences, such as deleting an entire codebase with no ability to "Redo/Undo" to retrieve any of the lost code.

Didn't commit? well, have fun trying to reconstruct your last three hours of your coding session - because it's gone and you have no way to get it back!

Please - allow some way to disable this demonic "feature".

When I click on a file in the file navigator, I expect the code editor to be the active element that any and all actions will be performed on. Having the focus stay on the file manager is utterly unintuitive and requires high attention to details to not mess up a work in progress.

@avshyz
Copy link

avshyz commented Mar 6, 2021

This is highly frustrating.
@isidorn Jet brains products has the same feature, but in their case there's a prompt, warning about the operation that's about to happen ("are you sure you want to undo file deletion / move of x files?")

@elis
Copy link

elis commented Mar 6, 2021

From the Stackoverflow thread mentioned by the OP, here's a quick fix that you can use by modifying the keybindings json to the following:


    {
        "key": "cmd+z",
        "command": "undo",
        "when": "editorFocus"
    },
    {
        "key": "cmd+z",
        "command": "-undo"
    },
    {
        "key": "shift+cmd+z",
        "command": "redo",
        "when": "editorFocus"
    },
    {
        "key": "shift+cmd+z",
        "command": "-redo"
    }

@slikk66
Copy link

slikk66 commented May 14, 2021

I would like to disable all keyboard operations for the file explorer, period. I just had to reconstruct missing files/folders that were appearing/disappearing, I have no idea how these things even were happening. I'd prefer no files get deleted, undeleted/redeleted etc unless I use the mouse and menu actions to perform file operations.

@watsonian
Copy link

I would like to reiterate that this needs to be addressed. I'm not sure why this feature was implemented, but it's caused me much grief. The behavior is unexpected and I find that I end up accidentally undoing file explorer operations when I had no intention of doing so several times per day. I've not once ever wanted to undo anything done in the explorer. So, this feature has introduced daily frustration to solve something that was never a problem. Behavior like this should be toggle-able and defaulted to disabled.

@gravity-addiction
Copy link

Why is this still an issue??? The issue wouldn't be so bad if the REDO command actually worked. The feature is broken and should never have made it to production. It's been an issue for 6 month, I spent a month on sublime due to this issue. been pretty good and just had a folder complete get erased, not in the garbage can, not anywhere. just f'in gone, and redo gave me an empty folder..

@h-archer
Copy link

h-archer commented Jul 11, 2021

This is an absolute joke!! The guy who thought of this "feature" needs to be put into prison for life!!! What are you thinking vscode team??? You have shown a lack of user commitment.

GET RID OF THIS NOW!!!!

@fedalvez
Copy link

I think is a cool feature, however it needs to be confirmed by the user before doing it.

@figloalds
Copy link

I would like to point out that I too fell victim to this diabolic "feature".
I had coded an entire new mechanism and while trying to undo multiple actions on a file elsewhere unrelated, the editor COMPLETELY UNDONE all my new work and it was not committed.
Luckily I was able to find my work on the windows trashbin, it could have been irreversible, this "feature" needs to be removed

@isidorn isidorn assigned JacksonKearl and unassigned isidorn Aug 12, 2021
@raygig
Copy link

raygig commented Aug 24, 2021

This is the most dangerous feature ever developed. PLEASE REMOVE IT!

@JacksonKearl
Copy link
Contributor

JacksonKearl commented Aug 24, 2021

Hello all, I recently acquired this ticket. It seems there may be separate issues going on here and I want to make sure I understand the problem fully. The issue title requests a way to disable undo/redo for file operations, but in the comments I see folks saying that they've experienced dataloss due to these operations. To me these seem like different issues: undo/redo causing dataloss sounds like a bug, and disabling the operations sounds like a request.

It would be helpful to me if someone could give a step by step description of how the dataloss is occurring (a screen recording on gifcap.dev would be helpful), and I will look to see how to fix that dataloss (the solution may indeed be to provide an option to disable file operations, but I don't know until I see what exactly is going on here).

I have tested with undoing/redoing renaming folders, nested folders, and files and did not experience dataloss.

I am aware of an outstanding ticket regarding undoing a folder deletion not working ( #111022) however I'm not sure this is what's happening here, as in that case the files are still available in the trash and the user explicitly requested they be deleted.

@space-alien
Copy link

@JacksonKearl Data loss is caused because undo/redo operations in File Explorer are executed without prompting the user. The thread above gives many examples where users have experienced this, and the enormous damage it can cause.

I think this can be summarised as the following requests:

  1. [MUST-HAVE] Introduce a prompt before executing undo/redo operations in File Explorer. Such actions are extremely infrequent for most users. And because the normal expectation is that undo/redo actions are targeting the code window, not the File Explorer, it is far too easy to suffer unintentional data loss. Adding this prompt is going to prevent, rather than create, friction.
  2. [NICE-TO-HAVE] Provide a setting option to disable undo/redo history on the File Explorer.

@JacksonKearl
Copy link
Contributor

@space-alien I will address any dataloss issues with the highest priority, but I can not if I do not have reproducible steps.

No reproducible steps have been written in this thread to-date, and in my testing I did not come across any dataloss myself. While I believe that dataloss may be occurring, I cannot fix it if I cannot see it (or at least see a general flow that may cause it)

If you want this resolved quickly, please, provide reproducible steps.

@gravity-addiction
Copy link

To reproduce, click on a folder in the vscode file sidebar
Copy ctrl-c
Paste ctrl-v
the folder exists with a "- copy" suffix and contents
ctrl-z to undo this folder copy (No Warning, but should be)
ctrl-shift-z to redo
folder is empty

@JacksonKearl
Copy link
Contributor

@gravity-addiction thanks, based on that a concrete step forward would be to show the delete folder prompt on undoing a paste folder operation. It's worth noting that in this case the "deleted" folder does still exist in the trash and the data is recoverable.

@JacksonKearl JacksonKearl modified the milestones: Backlog, On Deck Aug 26, 2021
@space-alien
Copy link

@JacksonKearl Thank you for the quick response on this.

Perhaps any kind of deletion operation should give rise to the confirmation prompt - not just folder deletion.

Work could also be lost by deleting copied files without warning, if that's where a developer starts making changes without renaming the new file.

@space-alien
Copy link

I just discovered this: https://github.com/microsoft/vscode-docs/blob/vnext/release-notes/v1_53.md#:~:text=We%20also%20show%20a%20confirmation%20dialog%20for%20destructive%20undo%20operations%20from%20the%20Explorer.

Perhaps this feature was not released after all, or since regressed?

I would also like to reiterate the request for a setting to disable undo/redo file ops in the Explorer. I just found myself inadvertently restoring deleted files - another non-delete operation I would like prevented by a setting or a confirmation prompt.

@JacksonKearl
Copy link
Contributor

@space-alien do the keybindings referenced here work for you?

@dorkk-online
Copy link

I literally just crashed my project because the undo removed all of my node modules. Although reinstalling node modules is an easy task I have lost multiple files and hours of work since the release of this feature.

@mark-hubers
Copy link

To me, this is just about permanently deleted! Yes, they end up in the trash, but on a macOS, my trash is enormous and you lose all the path info and spend hours at times trying to know what the hell it just deleted and where you need to restore it to. So let say you have not to edit some files (made a new one, move a folder, rename a file) in many days, and your editing your code and then say OK that idea did not work and I would do a undo about 2 to 5 times thinking I am removing my last 2 to 5 edits in that file but did not know my pointer still inside the explorer and BAM! I just mess up my file system with the last 2 to 5 things I did in there over the last few weeks. I do commit my changes but not every day or every hour so that is no help. This has happened over 3 to 5 times so far and HATE this as this is not a feature as this is a job killer as it cost time and money.
I am going to try the keyboard mapping in the hope this fixes it for now but this should not be our fix as you are forcing all the other poor souls that will get burned by this as well before they learn to patch it up with a keymap override.
Sorry is really upset as last time this cost me many hours and still not able to sleep thinking I miss something and will show up later on some prod system.

@tawani
Copy link

tawani commented Oct 19, 2021

This diabolic feature still exists? I just undid hours of work. When are you going to address this? Its been months since we started complaining.

@zakariamofaddel
Copy link

Same @tawani :( it was a very bad experience! Luckily I found my lost files in the trash and with some more work I was able to glue all the pieces back together.
This thought me to commit more often, but still a very dangerous feature that should be activated by user and disabled by default!

@zawhtetaung-amdon
Copy link

I didn't encounter this issue until i had to work with creating/updating several folders and files at once. For now I'm just reminding myself to close the window and reopen after every few changes to make sure there's nothing to delete when I accidentally undo.

@tsiege
Copy link
Author

tsiege commented Oct 28, 2021

@JacksonKearl OP here. As @gravity-addiction pointed out cmd+c, cmd+v, cmd+z is a common one. But this comes up with any action in the file finder, so dragging and dropping files or directories then cmd+z can cause it. The frustrating thing is it seems like it can happen along time after you've forgotten you did anything. So a real world example would be copying and pasting files or moving them or making new ones in the vcsode file explorer, doing (a lot of work) clicking on the file explorer to some other file and then thinking you're in that file and editing clicking cmd+z and bam all your work is gone. This has bitten me countless times since I first opened this and it seems like it has others too. It's particularly frustrating because the undone files are often not yet under version control and cannot be resolved by git. Hope that helps

@m-zavgorodniy
Copy link

m-zavgorodniy commented Nov 2, 2021

This feature is hell *tired, can we just remove it please guys

@tsiege
Copy link
Author

tsiege commented Nov 15, 2021

I'll chime in again, but I actually see the utility of this feature. It's nice to be able to copy and paste directories, as well as undo. But I think there should be an option to warn on file system undo as well as completely disabling it. It can be a highly destructive action and warrants confirmation from the user. Maybe it could be an option with undo values being always, warn, disabled?

@raygig
Copy link

raygig commented Nov 23, 2021

REMOVE THIS #$^&%@#!$ FEATURE OR GUARD IT WITH A CONFIRMATION DIALOG!!!

@cjhopman
Copy link

This is a terrible experience. I just lost about a day of work to this behavior. I don't know if it's related to working on a filesystem where vscode can't put things in trash, or if the undo buffer is too small or who knows, or if i accidentally did a real operation somewhere making vscode throw away the redo stack. Regardless of how it happened, I don't think it's a good idea to hijack such a common hotkey for destructive behaviors like deleting files and folders.

@pnadj
Copy link

pnadj commented Nov 29, 2021

Wow had my first run in with this, what a silly feature..

@monim67
Copy link

monim67 commented Nov 30, 2021

If this feature exists it should exist disabled by default.

@wandeber
Copy link

Lost entire directory... It's not the first time I think I am undoing inside the text editor but I'm undoing in the directories. I can not hate this thing more ^^'

@JacksonKearl
Copy link
Contributor

In today's insiders is a new setting explorer.enableUndo which defaults to warn, providing a warning in the case of undoing create-via-paste/etc. events, and also supports options of allow (maintaining the old behavior), or never (explorer does not participate in undo at all).

Please do let me know if you encounter any deletion events that are not properly warned about under the new warn setting.

@borislav-risika
Copy link

Holy shit, who in their right mind thought this was a good feature?

@Reyescult
Copy link

I gotta say, this and the undo after close/open are the kind of 'features' that make me HATE a program that I used to love. Making seemingly arbitrary changes to a default workflow that has existed for YEARS is a recipe for disaster, and this one is particularly nasty. I mean, what developer in their right mind would want such a destructive change to the default workflow of a program they have been using for any extended period of time? I had inadvertently been on an older version of VSCode for a while, and only discovered this madness recently. It has completely blown my workflow and caused me a LOT of problems.

@JacksonKearl
Copy link
Contributor

With tomorrow's Insiders (next week's Stable) this is now split this into two settings, explorer.enableUndo is a boolean controlling whether the explorer participates in Undo at all, and explorer.confirmUndo is an enum configuring how frequently to prompt before undoing.

@tsiege
Copy link
Author

tsiege commented Jan 31, 2022

Thanks so much @JacksonKearl. Really appreciate the response on this

@github-actions github-actions bot locked and limited conversation to collaborators Feb 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality file-explorer Explorer widget issues insiders-released Patch has been released in VS Code Insiders on-testplan undo-redo Issues around undo/redo
Projects
None yet
Development

Successfully merging a pull request may close this issue.