code-server icon indicating copy to clipboard operation
code-server copied to clipboard

Theme resets to default on relaunch

Open sobakaio opened this issue 6 years ago • 24 comments

  • Web Browser: Google Chrome Version 86.0.4240.111 (Official Build) (x86_64)
  • Local OS: MacOS 10.15.7
  • Remote OS: Ubuntu 20.04
  • Remote Architecture: x86-64
  • code-server --version: v3.6.1

After the latest update my selected theme resets to default Light+ after one or several consecutive client restarts. It doesn't matter what theme is selected before. If I open settings.json on server I see the theme is correct, but in workbench it resets to default. When the theme resets and I open Preferences -> Color Theme then it also resets in settings.json to "workbench.colorTheme": "Default Light+". Very weird.

I attach small video for the sake of demonstration https://cloud.dmitriypavlov.com/s/9YoT5scWALkcyq9 (theme resets on 3 relaunch). Please advice.

sobakaio avatar Oct 24 '20 17:10 sobakaio

Same issue here too.

hurleyef avatar Oct 25 '20 02:10 hurleyef

The workaround is to change the default theme to used one in Settings.

sobakaio avatar Oct 25 '20 09:10 sobakaio

Probably related to this: I can't change appearance ex: I usually hide the Run button. Toggle Word Wrap doesn't work ether (doesn't activate at all).

  • Web Browser: Firefox 82.0 (64-bit)
  • Local OS: Windows 10 (1909)
  • Remote OS: Alpine 3.12.1
  • Remote Arch: x86-64
  • code-server: v3.6.1

ZeeMoros avatar Oct 25 '20 11:10 ZeeMoros

Probably related to this: I can't change appearance ex: I usually hide the Run button. Toggle Word Wrap doesn't work ether (doesn't activate at all).

Have no issues like that: can turn off panels and wrapping works.

sobakaio avatar Oct 25 '20 12:10 sobakaio

@code-asher With code-server 3.6.1, settings in ~/.local/share/code-server/User/settings.json are set as Remote only whereas with code-server 3.6.0 they are set both as User and Remote:


3 6 1-settings


3 6 0-settings

Update (2020-11-03): Problem also exists with code server 3.6.2

benz0li avatar Nov 02 '20 21:11 benz0li

I noticed this as well. First, it seems like the settings.json file in code-server/User is being ignored. If I copy the file from code-server/User to code-server/, however, and use Preferences: Open Setting (JSON) it still shows me a different file but with the same path. Very odd.

Not the paths shown for the two settings.json files in the screenshots below. Same path, different content.

image image

vnijs avatar Nov 03 '20 05:11 vnijs

Yeah I poked into it a little and it looks like the settings file on disk is now used for remote only (which won't be used at all for code-server since it can't run the remote extensions anyway) and the user settings are now stored in browser storage.

But even though it's actually in browser storage it still shows a file path in the editor and there seem to be other bugs with it too.

I haven't done any research yet to see if this is a known issue with VS Code web or if it's something caused by code-server, so I'll be checking on that as soon as possible.

code-asher avatar Nov 03 '20 16:11 code-asher

Thanks for checking on this @code-asher. Do you know if there is a way to update/change these user settings from the command line? I would usually just copy a settings.json file to the desired location. Not sure how that would work with a "file" in browser storage however.

vnijs avatar Nov 04 '20 10:11 vnijs

Thanks for checking on this @code-asher. Do you know if there is a way to update/change these user settings from the command line? I would usually just copy a settings.json file to the desired location. Not sure how that would work with a "file" in browser storage however.

Hey I did my own research and found out that if I simply copy settings.json from /User (remote) to /code-server (local) it would have no effect at all as local settings seems to be virtual path and actually stored in browser Local Storage.

What I did is simply opened User preferences within code-server itself (cmd + shift + P, "settings") and pasted it's contents to local settings.json within code-server. Obviously when browser Local Storage resets this settings are lost.

Thanks all the devs for the commitment.

sobakaio avatar Nov 04 '20 10:11 sobakaio

Yeah I don't think there's an easy way to do this; copying manually like that seems like the only option.

The whole situation seems a bit weird to me so assuming VS Code doesn't make some kind of improvement I think maybe we should patch it to use the file system again.

code-asher avatar Nov 04 '20 18:11 code-asher

I have to change my theme back every 20 minutes. Someone please find a fix for this one!

bobbywaz avatar Nov 08 '20 19:11 bobbywaz

@code-asher I assume there is no way to use the settings-sync feature from VS Code correct (link below)? Is that feature perhaps why they are using browser storage now? Reverting/patching so the file system can be used for code-server would be great.

https://code.visualstudio.com/docs/editor/settings-sync

vnijs avatar Nov 08 '20 20:11 vnijs

Yeah I'm not sure we'd be able to get sync working as-is; we might need to host our own backend since I imagine Microsoft's is licensed similarly to the marketplace and there might be other hurdles.

The switch to browser storage could be related to sync but they had sync before the switch so I'm not sure.

Right now my plan is to update to 1.51 and see if the situation has changed and if not I'll dig in to resolve this.

code-asher avatar Nov 09 '20 16:11 code-asher

Actually no; the switch happened at the same time as sync right? Definitely could be related.

code-asher avatar Nov 09 '20 16:11 code-asher

I hate to be that guy, but is there any progress on this issue? It's really not feasible to remain on the old version now with the security vulnerability and this is a really annoying problem when you switch between directories.

hluker avatar Nov 20 '20 01:11 hluker

@hurleyef Do you know which prior version are affect by the security vulnerability. I thought it was only 3.7.1.

vnijs avatar Nov 20 '20 01:11 vnijs

Whoops, that's my bad -- only 3.7 and 3.7.1 are affected.

hluker avatar Nov 20 '20 02:11 hluker

I hate to be that guy, but is there any progress on this issue? It's really not feasible to remain on the old version now with the security vulnerability and this is a really annoying problem when you switch between directories.

The workaround was already posted here. Just copy the settings file contents.

sobakaio avatar Nov 20 '20 07:11 sobakaio

@dmitriypavlov Not sure how useful that workaround really if "Obviously when browser Local Storage resets this settings are lost"

vnijs avatar Nov 20 '20 07:11 vnijs

The workaround was already posted here. Just copy the settings file contents.

@dmitriypavlov I think you are assuming that everyone uses only 1 computer. One of the key benefits of code-server is being able to remotely edit from any computer. Each computer/browser has its own local storage. Are you implying that I manually copy these settings to each computer I am going to use? If I make changes to the settings on my main personal system, those changes are not applied to my laptop or my work system, etc..

JtMotoX avatar Nov 20 '20 08:11 JtMotoX