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

Portable mode: Presence of data folder prevents --user-data-dir command-line override #63657

Closed
myfonj opened this issue Nov 22, 2018 · 5 comments
Assignees
Labels
*out-of-scope Posted issue is not in scope of VS Code

Comments

@myfonj
Copy link

myfonj commented Nov 22, 2018

  • VSCode Version: 1.29.1 bc24f98
  • OS Version: Windows 10 (1709)

Steps to Reproduce:

  1. Have content of VSCode-...-.zip unpacked into say C:\apps\VSCode
  2. Create C:\apps\VSCode\data folder (docs)
  3. Invoke C:\apps\VSCode\bin\code.cmd --user-data-dir C:\other-data-dir
    (aside: no command-line argument apparently works on C:\apps\VSCode\Code.exe (Portable mode does not allow running command line commands. #57185))

Expected outcome:
C:\other-data-dir folder is created and populated with default profile (or used if existed already).

Actual outcome:
C:\apps\VSCode\data\user-data folder is created and populated, rendering command-line switch ineffective.

  1. delete C:\apps\VSCode\data folder
  2. Repeat step 3.

Actual outcome is now correct.

@joaomoreno
Copy link
Member

Yeah, the user-data-dir command line flag is ignored in portable mode. What is the actual use case for it?

@joaomoreno joaomoreno added the info-needed Issue requires more information from poster label Nov 26, 2018
@myfonj
Copy link
Author

myfonj commented Nov 26, 2018

What is the actual use case for it?

Testing.

code.cmd --user-data-dir C:\throwaway-vanilla-profile --extensions-dir C:\throwaway-no-extensions should ensure you run clean slate vanilla VSC without need to wipe your settings, move any folder etc, resulting in better and more reliable bugreports. Perhaps.

Consistency.

It is documented to do something, not documented not to do that in certain circumstances, so one could expect it to work all the time. Command line arguments generally serve such purpose.

@joaomoreno
Copy link
Member

joaomoreno commented Nov 26, 2018

It is documented to do something, not documented not to do that in certain circumstances, so one could expect it to work all the time. Command line arguments generally serve such purpose.

Well, you could apply the same argument about portable: it is documented to do something, not documented not to do that in certain circumstances (when using --user-data-dir). It comes down to: which feature has priority?

I think you are right, though, in that a command line flag should have priority.

@joaomoreno joaomoreno added bug Issue identified by VS Code Team member as probable bug workbench-os-integration Native OS integration issues portable-mode VS Code portable mode issues and removed info-needed Issue requires more information from poster labels Nov 26, 2018
@joaomoreno joaomoreno added this to the Backlog milestone Nov 26, 2018
@myfonj
Copy link
Author

myfonj commented Jan 22, 2019

BTW, I think that until this issue is resolved it would be worth mentioning this peculiarity in the aforementioned documentation page to prevent possible frustration of fellow portable mode users.

I. e. current

--user-data-dir <dir> | Specifies the directory that user data is kept in, (...).

Amend like

--user-data-dir <dir> | Unless using portable mode, specifies the directory that user data is kept in, (...).

@joaomoreno joaomoreno added *out-of-scope Posted issue is not in scope of VS Code and removed bug Issue identified by VS Code Team member as probable bug portable-mode VS Code portable mode issues workbench-os-integration Native OS integration issues labels Nov 2, 2020
@joaomoreno joaomoreno removed this from the Backlog milestone Nov 2, 2020
myfonj added a commit to myfonj/vscode-docs that referenced this issue Nov 4, 2020
Portable mode (presence of  `/data/` folder in VSC installation directory) effectively prevents `--user-data-dir` and `--extensions-dir` switches from working.
Been told it is OK and will not be changed: microsoft/vscode#63657
This info could potentially save a lot of WTH moments and confused fuddling to folks looking at this docs and not getting it working in their "Portable installs" when for example trying to launch a "vanilla" profile without touching their `/data/` directory.
(This edit is crude, probably would be better as a note below table, but I couldn't figure it out how to formulate and mark it.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
*out-of-scope Posted issue is not in scope of VS Code
Projects
None yet
Development

No branches or pull requests

4 participants
@joaomoreno @bpasero @myfonj and others