Skip to content

Restore hot-exit files to the correct instance when renaming workspace folder #26533

Closed

Description

@Binly42
  • VSCode Version: 1.12.1
  • OS Version: Windows7 64bit SP1 with latest update

Steps to Reproduce:

  1. open a folder, and then open and modify some files ;
  2. (under the setting {"files.hotExit": "onExitAndWindowClose"} ,) close the window ;
  3. rename the folder (, or change its location) ;
  4. open that folder with vscode ;
  5. the restoring fails ;

*6. if undo the rename and/or move of the folder, everything seems to be fine again ;

So, imho maybe the archive about hotExit (or some related params (likethe current path of the folder to be restored) ) should be stored in the ./.vscode ?

Activity

  1. bpasero commented on May 12, 2017

    @bpasero
    Contributor

    Daniel Imms (@Tyriar) we should be able to restore the files maybe as untitled files to one window so that at least the data is not lost?

  2. added
    workbench-hot-exit
    on May 12, 2017
  3. slodki commented on May 12, 2017

    @slodki

    look at #26545

  4. bpasero commented on May 14, 2017

    @bpasero
    Contributor

    Ok this is not data loss but inconvenience: we do open the dirty files in a separate window as untitled files and not within the instance where the renamed folder was opened. I do not think we could actually support this in any way unless we would track file events between restarts of VS Code.

  5. added
    feature-request
    on May 14, 2017
  6. changed the title [-]Restoring (after hotExit) fails once the name (or path) of the folder was changed[/-] [+]Restore hot-exit files to the correct instance when renaming workspace folder[/+] on May 14, 2017
  7. Binly42 commented on May 15, 2017

    @Binly42
    Author

    Actually I can understand that is not data loss. If it did lose data, I would not be able to see the 6-th step among the steps-to-reproduce in my first post.
    So I guess it is just a error that cannot find any saved archive when addressing to the changed new path.

    If my understand is not wrong, it may be not necessary to track the file events (on VSCode's own).
    What I imagine is that VSCode records and restores the status of the folder relying on the path. Instead, working with a certain identifier, which is independent of the physical path, for example a unique id established whenever the folder was opened at the first time. I think this may work ...

    Also I know this may be a really little need/feature for what the name hot-exit suggests ...

    I am sorry for my poor english ...

  8. Tyriar commented on May 15, 2017

    @Tyriar
    Contributor

    Benjamin Pasero (@bpasero) we were talking about a command to open workspaces that have backups, I still believe that would be useful and could help with this.

    As for tracking the change in the folder I can't think of a nice way to do it. We could mitigate the problem by providing a command like above and maybe a command that opened the actual backup folder in explorer/finder so users don't need to hunt for them manually.

  9. ctsstc commented on Aug 30, 2017

    @ctsstc

    I'm not sure if this is related, it seems to be semi-related; I can open a new issue if needs be.

    I created a new window that did not yet have a directory opened (there was another window opened with a project/directory that I spawned the new window from). I created a new file in this new window, the file was populated but not saved, my system restarted for updates and I lost the file. So is that file saved somewhere to some odd namespace and I can restore it, or is it gone forever?

    Edit: wait, I just found a spare window somewhere, so maybe when it restarted it relaunched two windows instead of one! Might be good to keep an eye on this type of case when changing this out though. I'm so glad it managed to come back :) I had opened a new window from the last project it auto opened, hoping to see the lost file there, but there was nothing. I guess it just opened two windows instead of just one which I'm used to it only launching 1.

  10. added
    *out-of-scope
    on Sep 12, 2018
  11. vscodebot commented on Sep 12, 2018

    @vscodebot

    This iteration we focus on issue grooming. This issue is being closed to keep the number of issues in our inbox on a manageable level, we are closing issues that are not going to be addressed in the foreseeable future: We look at the number of votes the issue has received and the number of duplicate issues filed. More details here. If you disagree and feel that this issue is crucial: We are happy to listen and to reconsider.

    If you wonder what we are up to, please see our roadmap and issue reporting guidelines.

    Thanks for your understanding and happy coding!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

*out-of-scopefeature-requestworkbench-hot-exit

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions