Skip to content

Add --app-icon to set the favicon and PWA icon - #8168

Open
simonepri wants to merge 1 commit into
coder:mainfrom
simonepri:feat/app-icon
Open

simonepri wants to merge 1 commit into
coder:mainfrom
simonepri:feat/app-icon

Conversation

@simonepri

Copy link
Copy Markdown

Fixes #8145

--app-name renames code-server, but the tab and an installed PWA still show the code-server logo, so operators who run it as one app among several cannot give it an icon that matches the name. The only workaround is overwriting files under src/browser/media in the installed release, which breaks when an upgrade renames or adds icon files.

--app-icon (or app-icon in the config file) takes a PNG or SVG file. code-server serves it at the bundled icon URLs that the login page, the error page and VS Code's workbench already link to, so every page picks it up without touching the VS Code patches. The manifest lists the custom icon once with its real type and size: an SVG fits any size, and a PNG's width and height are read from its header, since browsers only offer to install an app whose manifest declares a large enough icon. The maskable variants are dropped for a custom icon, because browsers crop those to a shape. Any other file type is rejected at startup.

On naming: I went with --app-icon to pair with --app-name, as proposed in the issue; happy to rename.

`--app-name` renames code-server, but the tab and an installed PWA still
show the code-server logo, so operators who run it as one app among
several cannot give it an icon that matches the name. The only way today
is to overwrite files under src/browser/media in the installed release,
which breaks when an upgrade renames or adds icon files.

`--app-icon` (or `app-icon` in the config file) takes a PNG or SVG file.
code-server serves it at the bundled icon URLs that the login page, the
error page and VS Code's workbench all link to, so every page picks it up
without a change to the VS Code patches. The manifest lists the custom
icon once with its real type and size (an SVG fits any size; a PNG's
width and height are read from its header, since browsers only offer to
install an app whose manifest declares a large enough icon), and drops
the maskable variants, which browsers would crop to a shape. Any other
file type is rejected at startup.

Fixes coder#8145

Assisted-by: AI
@simonepri
simonepri requested a review from a team as a code owner December 1, 2026 11:08

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add an option to set the favicon and PWA icon, like --app-name

1 participant