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

settings.json seems not functioning as expected #4263

Closed
OliverwengFiltered opened this issue Sep 28, 2021 · 22 comments
Closed

settings.json seems not functioning as expected #4263

OliverwengFiltered opened this issue Sep 28, 2021 · 22 comments
Labels
waiting-for-info Waiting for more information from submitter

Comments

@OliverwengFiltered
Copy link

OS/Web Information

  • Web Browser: Chrome latest
  • Local OS:
  • Remote OS: GCP Ubuntu 20.04
  • Remote Architecture:
  • code-server --version: 3.12.0

Steps to Reproduce

  1. use gcp compute engine unbuntu image to spin up the vm machine.
  2. install latest 3.12.0
  3. put the below content at /home/xxx/.local/share/code-server/User/settings.json
{
    "workbench.colorTheme": "Monokai",
    "terminal.integrated.shell.linux": "/bin/bash",
    "workbench.startupEditor": "readme",
    "terminal.integrated.defaultProfile.linux": "bash"
}

Expected

the welcome page should not show up when the folder has the read me.

Actual

the welcome page showed up regardless of the "workbench.startupEditor": "readme"

@jsjoeio jsjoeio added the needs-investigation This issue needs to be further investigated label Sep 28, 2021
@jsjoeio
Copy link
Contributor

jsjoeio commented Sep 28, 2021

I just tested and it works as expected.

  • Open a Folder without readme -> shows Welcome
  • Open a Folder with a readme -> shows readme

image

Are you sure your folder has a readme? I used readme.md and it worked. What's the folder tree look like for that folder you're trying?

Are there any logs in the browser?

@OliverwengFiltered
Copy link
Author

OliverwengFiltered commented Sep 29, 2021

It's still reproducible on my end.

here is the screen shots.
Screen Shot 2021-09-29 at 1 21 17 PM
Screen Shot 2021-09-29 at 1 25 30 PM

@jsjoeio
Copy link
Contributor

jsjoeio commented Sep 29, 2021

I don't know if casing is important. Your file is called README but I tried with readme because that's how you spelled it in settings.json. Can you try that?

Also, those service worker errors happen if you're running code-server in an insecure environment (i.e. not using HTTPS).

@jsjoeio jsjoeio added waiting-for-info Waiting for more information from submitter and removed needs-investigation This issue needs to be further investigated labels Sep 29, 2021
@OliverwengFiltered
Copy link
Author

OliverwengFiltered commented Sep 29, 2021

to reproduce, I think all you need to do is open it in incog mode.

I think it's reading the setting from browser storage, instead of the server side. (Or maybe it got overriden due to certain timing difference.)

Please let me know if you can reproduce it via incog mode.

@jsjoeio

@jsjoeio
Copy link
Contributor

jsjoeio commented Sep 29, 2021

Okay I just tested in incognito and I cannot reproduce :( I wonder if it's related to you not using a secure environment. Can you please try with code-server running via HTTPS? You can use code-server --link

Screen.Recording.2021-09-29.at.12.22.16.PM.mov

@OliverwengFiltered
Copy link
Author

OliverwengFiltered commented Sep 29, 2021

Hi @jsjoeio ,

I made an example of how to reproduce and sent an email to

Let me know if you can reproduce with the link I sent.

@jsjoeio
Copy link
Contributor

jsjoeio commented Sep 29, 2021

@OliverwengFiltered ahh... do you mind posting here instead? That way, it's all documented in public and others will be able to see it. (that's my personal email and shouldn't be used, I only use it for commits so everything is tied to the same address. [email protected] should be used but only if I ask you too)

@jsjoeio
Copy link
Contributor

jsjoeio commented Sep 29, 2021

@OliverwengFiltered Okay I took a look and I see what you mean but until we resolve other issues, I don't think we can isolate this down. Can you please try using HTTPS and seeing if the issue persists?

Remember, you're telling VS Code to use a readme instead of the Welcome page. It renders the readme in a webview. Webviews are not guaranteed to work properly in insecure environments (i.e. HTTP), which is what you're using. I can't say that's forsure the issue, but unfortunately, you need to test and see if that resolves it, otherwise I won't be able to help!

@OliverwengFiltered
Copy link
Author

@jsjoeio ,

I'm sorry for the email thing.

Back to the topic: I have a proxy on my local and it's https enabled, but can still produce the same issue.

and also if I downgrade the version of the code server to previous one, it works fine.

@OliverwengFiltered
Copy link
Author

it almost feels like this issue happens again: #2274

@jsjoeio
Copy link
Contributor

jsjoeio commented Sep 29, 2021

I'm sorry for the email thing.

No worries at all! Happens all the time. Thanks for understanding!

Back to the topic: I have a proxy on my local and it's https enabled, but can still produce the same issue.

Interesting...so when you use the proxy + https, do the service workers go away?

and also if I downgrade the version of the code server to previous one, it works fine.

argh. that's no good. Hmm...is there anything else about your setup that might be related? i.e. what does your config.yaml look like or what flags are you using with code-server?

I think @code-asher fixed an issue with this in the past. Maybe he has an idea

@code-asher
Copy link
Member

code-asher commented Oct 1, 2021 via email

@prabushi
Copy link

prabushi commented Nov 11, 2021

I'm facing a similar issue.

code-server: v3.12.0
VS Code: v1.60.0
Commit: 4cd55f94c0a72f05c18cea070e10b969996614d2
Date: 2021-09-15T19:34:37Z (1 mo ago)
Browser: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36

Have the following in User/setting.json

{
    "workbench.startupEditor": "none"
}

It goes to the Getting Started walkthrough page at the start if I try the code-server on an incognito window.
Screenshot 2021-11-11 at 13 46 21
However, once I Mark Done on this walkthrough page and reload the window, VS Code behaves according to the defined settings in the current incognito view.
If I close the incognito window and open a new incognito window, I get the Getting Started walkthrough page again. (Suppose the code-server uses browser storage to preserve states)

@jsjoeio @code-asher
Could you please let me know if there's a way to skip this Getting Started walkthrough page at the start?

@jsjoeio
Copy link
Contributor

jsjoeio commented Nov 12, 2021

User/setting.json

Looks like you have a typo -> should be settings.json. Does that fix it?

Otherwise, @code-asher just fixed this in our e2e test suite with that same setting and it worked. See here. There could be something else at play

@prabushi
Copy link

Thanks for the reply.

Looks like you have a typo -> should be settings.json. Does that fix it?

My bad, it's settings.json.

Otherwise, @code-asher just fixed this in our e2e test suite with that same setting and it worked. See here. There could be something else at play

Will check once the new release is available.

@jsjoeio
Copy link
Contributor

jsjoeio commented Nov 15, 2021

Will check once the new release is available.

Sorry, you shouldn't have to wait for a release to check this! We haven't added anything new. I'm saying that he fixed it in an e2e test meaning I know it's currently working as expected

@prabushi
Copy link

prabushi commented Nov 30, 2021

Will check once the new release is available.

Sorry, you shouldn't have to wait for a release to check this! We haven't added anything new. I'm saying that he fixed it in an e2e test meaning I know it's currently working as expected

I tried with the codercom/code-server:latest docker image. Still, the behavior is the same.

720.mov

Once I clear the cache, the welcome page pops up for the first time even with the "workbench.startupEditor": "none" setting. But, it honors the setting when I reload the window. We are trying to avoid this welcome page popping up for the first time.

I'm not sure if it's the same code-server version that is used in your e2e tests. Is there a way to access the version that is used in your e2e tests environment?

@jsjoeio
Copy link
Contributor

jsjoeio commented Nov 30, 2021

Once I clear the cache, the welcome page pops up for the first time even with the "workbench.startupEditor": "none" setting.

Hmm this is very strange 🤔

I'm not sure if it's the same code-server version that is used in your e2e tests

Our e2e tests use the latest version (which isn't released). It will be 4.0.0 when it comes out.

Is there a way to access the version that is used in your e2e tests environment?

You could download the release-packages artifact from CI. It will have all the releases (it's a big file). Then you can run locally.

# download folder
cd release-packages 
# example: macOS
tar -xzf code-server-3.12.0-macos-amd64.tar.gz
./code-server-3.12.0-macos-amd64/ <pass flags here>

@benz0li
Copy link
Contributor

benz0li commented Dec 11, 2021

@prabushi #4263 (comment) (Repeated Getting Started walkthrough) has to do with #4212.

With 'incognito mode'/'private windows' there is no way to skip the Getting Started walkthrough page, as this prevents storing browser data.

@code-asher
Copy link
Member

This is an interesting comment:

https://github.com/microsoft/vscode/blob/25d0e27e292fad4454151b85521014d4c92a3aa7/src/vs/workbench/contrib/welcome/page/browser/welcomePage.ts#L53

Looks like there are some conditions in which the welcome page will always show up regardless of startupEditor's value.

@kfriend
Copy link

kfriend commented Feb 14, 2022

Per @code-asher's comment, and this line https://github.com/microsoft/vscode/blob/25d0e27e292fad4454151b85521014d4c92a3aa7/src/vs/workbench/contrib/welcome/page/browser/welcomePage.ts#L55, I would assume disabling telemetry would disable the welcome screen even for first-load incognito. Seems to work for me.

"telemetry.enableTelemetry": false

@code-asher
Copy link
Member

Closing since I think this is working as intended at the moment. But let me know if I missed something.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting-for-info Waiting for more information from submitter
Projects
None yet
Development

No branches or pull requests

6 participants