Should ChromeOS be considered Linux (for fonts at least)?
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?
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.
Created https://github.com/microsoft/vscode/pull/248133 to fallback to Linux fonts instead. I didn't see any obvious similar situations from a quick check.
Created https://github.com/microsoft/vscode/issues/247766 to update the user agent detecting for Linux to also include Chrome OS.
@bpasero fyi as the reviewer of https://github.com/microsoft/vscode/pull/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?