gitpod-io / openvscode-server

Run upstream VS Code on a remote machine with access through a modern web browser from any device, anywhere.
https://www.gitpod.io/
MIT License
4.84k stars 423 forks source link

Unable to re-use existing vscode configuration - `user-data-dir` is not configurable #512

Closed drupol closed 1 year ago

drupol commented 1 year ago

The --user-data-dir command-line parameter is currently implemented in openvscode-server. However, its functionality is hampered due to an automatically appended /data directory, rendering the parameter completely ineffective.

The proposed minor modification allows users to accurately customize this variable, enhancing its utility.

With this change, I'm now capable of effectively reusing an existing vscode configuration.

Does this issue occur when all extensions are disabled?: Yes/No

Steps to Reproduce:

  1. Launch vscode with: openvscode-server --accept-server-license-terms --without-connection-token --host=0.0.0.0 --port=8080 --extensions-dir=/home/pol/.vscode/extensions --log=trace --user-data-dir="/home/pol/.config/Code"
  2. Connect to the UI and modify the settings
  3. Look at the logs:
    [10:31:08] [File Watcher (node.js)] [raw] ["change"] settings.json
    [10:31:08] [File Watcher (node.js)] [CHANGED] /home/pol/.config/Code/data/Machine/settings.json
    [10:31:08] [File Watcher (node.js)] [raw] ["change"] settings.json
    [10:31:08] [File Watcher (node.js)] [CHANGED] /home/pol/.config/Code/data/Machine/settings.json
    [10:31:08] [File Watcher (node.js)] [raw] ["change"] settings.json
    [10:31:08] [File Watcher (node.js)] [CHANGED] /home/pol/.config/Code/data/Machine/settings.json
    [10:31:08] [File Watcher (node.js)] [raw] ["change"] settings.json
    [10:31:08] [File Watcher (node.js)] [CHANGED] /home/pol/.config/Code/data/Machine/settings.json
    [10:31:08] [File Watcher (node.js)] [raw] ["change"] settings.json
    [10:31:08] [File Watcher (node.js)] [CHANGED] /home/pol/.config/Code/data/Machine/settings.json
    [10:31:08] [File Watcher (node.js)] [raw] ["change"] settings.json
    [10:31:08] [File Watcher (node.js)] [CHANGED] /home/pol/.config/Code/data/Machine/settings.json
    [10:31:08] [File Watcher (node.js)] >> normalized [CHANGED] /home/pol/.config/Code/data/Machine/settings.json
    [10:31:08] [File Watcher (node.js)] >> normalized [CHANGED] /home/pol/.config/Code/data/Machine/settings.json
    [10:31:08] [File Watcher (node.js)] >> normalized [CHANGED] /home/pol/.config/Code/data/Machine/settings.json
  4. You can see that a 'data' directory has been appended to the --user-data-dir
jeanp413 commented 1 year ago

@drupol thanks for reporting this and creating a PR but this kind of issue should be reported upstream and fixed in vscode repo, once merged we will fetch the upstream changes :pray:

drupol commented 1 year ago

@jeanp413 I've opened the issue at microsoft/vscode but it seems like it's stalling. Is there something we can do to push things further?

drupol commented 1 year ago

Dear @jeanp413, I'm a bit concerned, I haven't got any single reply from my pull request on the upstream project.

Don't you think we should fix this issue within this project?

Thanks.

jeanp413 commented 1 year ago

mmmm yeah it takes time sometimes, but from the comment in the PR it seems they probably would merge it. I'll make an exception and merge it as the change is really small :+1:

drupol commented 1 year ago

Cool, thank you very much !

jeanp413 commented 1 year ago

I'd recommend to duplicate this issue in the upstream repo too, just changing openvscode-server with ./scripts/code-server.sh so they have a corresponding issue to link the PR and a way to track it there too

drupol commented 1 year ago

I will sort this out tomorrow, thanks for your assistance.

jeanp413 commented 1 year ago

Cherry-picked the commit, it will be available next stable release 1.79 which will be out tomorrow or Friday Closign this