Skip to content

Should ChromeOS be considered Linux (for fonts at least)? #247766

Closed as not planned

Description

I was looking into a fonts issue a ChromeOS user was having and noticed that their default font setting is Consolas which surprised me as I thought for Linux it should be Droid Sans Mono.

However, I then came across this:
https://github.com/microsoft/vscode/blob/main/src/vs/editor/common/config/editorOptions.ts#L5428

The font is set to DEFAULT_MAC_FONT_FAMILY if Mac, otherwise DEFAULT_LINUX_FONT_FAMILY if Linux, otherwise DEFAULT_WINDOWS_FONT_FAMILY.

The criterior for Linux on the web is navigator.userAgent.indexOf('Linux') >= 0:
https://github.com/microsoft/vscode/blob/main/src/vs/base/common/platform.ts#L103

This is false for users on ChromeOS though:
https://www.whatismybrowser.com/guides/the-latest-user-agent/chrome-os

My question here is two fold.

Firstly, should the userAgent detection for Linux match both Linux and CrOS (assuming that Linux is the best match from Chrome OS).

And secondly, is falling back to Windows for an unrecognised OS the best option? Would Linux have more compatibility with more unknown OSs?

Activity

  1. hediet commented on Apr 30, 2025

    @hediet
    Member

    And secondly, is falling back to Windows for an unrecognised OS the best option? Would Linux have more compatibility with more unknown OSs?

    I guess detecting windows should be quite reliable, and if detection fails, it is probably a linux based system, so changing the fallback sounds reasonable.

  2. a-stewart commented on May 5, 2025

    @a-stewart
    ContributorAuthor

    Created #248133 to fallback to Linux fonts instead. I didn't see any obvious similar situations from a quick check.

    Created #247766 to update the user agent detecting for Linux to also include Chrome OS.

  3. a-stewart commented on May 22, 2025

    @a-stewart
    ContributorAuthor

    Benjamin Pasero (@bpasero) fyi as the reviewer of #248134

    After testing this a bit, we have noticed that detecting ChromeOS as Linux would cause the UI to use the Ubuntu font as for some reason ChromeOS does not provide a system-ui font.

    We'll investigate this further on our side - but perhaps the best approach would be to treat ChromeOS as a completely separate OS and offer an isChromeOS flag?

  4. added
    under-discussion
    on Dec 9, 2025
  5. vs-code-engineering commented on Nov 12, 2026

    @vs-code-engineering
    Contributor

    Thanks for the context. The editor-font fallback was changed in 146b12c: ChromeOS and other non-Mac, non-Windows platforms now use the Linux editor-font defaults rather than Consolas. Your later suggestion to detect ChromeOS separately is also implemented in cf84cd4, which adds the isChromeOS platform flag and context key without treating ChromeOS as Linux. Together these address both parts of this discussion, so this can be closed as completed. The fix shipped in 1.138.0.

    This issue was closed automatically: the fix shipped in 1.138.0, proposed by the VS Code sweeper and confirmed by an independent second review. It is closed as "not planned" rather than "completed" only because a "completed" close would put this already-shipped fix back into the current milestone's verification queue. If it still reproduces on 1.138.0 or later, reply here or reopen the issue and a maintainer will take a look.

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

Metadata

Metadata

Labels

under-discussion

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions