feat: use --app-name in error page title#7693
Open
lustsazeus-lab wants to merge 1 commit intocoder:mainfrom
Open
feat: use --app-name in error page title#7693lustsazeus-lab wants to merge 1 commit intocoder:mainfrom
lustsazeus-lab wants to merge 1 commit intocoder:mainfrom
Conversation
- Replace hardcoded 'code-server' with {{APP_NAME}} template in error.html
- Add APP_NAME replacement in errors.ts using req.args['app-name']
- Add tests for custom app-name and default value
code-asher
approved these changes
Mar 4, 2026
Member
There was a problem hiding this comment.
Thank you for tackling this! We might want to use the i18n strings for this eventually (like the login title), but this is definitely a step in the right direction.
FYI I modified your PR description from "fixes" and "closes" to "partially addresses" because to fully fix that issue we also need to set the VS Code titles (I think? I need to test actually. Edit yeah app name does not currently affect VS Code titles.)
| .replace(/{{ERROR_HEADER}}/g, statusCode.toString()) | ||
| .replace(/{{ERROR_BODY}}/g, escapeHtml(err.message)), | ||
| .replace(/{{ERROR_BODY}}/g, escapeHtml(err.message)) | ||
| .replace(/{{APP_NAME}}/g, (req.args && req.args["app-name"]) || "code-server"), |
Member
There was a problem hiding this comment.
Super minor note, but I believe req.args is always set so there is no need to check for it. Could just be req.args["app-name"] || "code-server".
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes partially addresses #7688 - when using --app-name flag, the error pages should display the custom app name instead of hardcoded "code-server".
Changes
Testing
Partially addresses #7688