René's URL Explorer Experiment


Title: Expand ~ in path options from the config file by harshbhx · Pull Request #8055 · coder/code-server · GitHub

Open Graph Title: Expand ~ in path options from the config file by harshbhx · Pull Request #8055 · coder/code-server

X Title: Expand ~ in path options from the config file by harshbhx · Pull Request #8055 · coder/code-server

Description: Fixes #7051 Summary Expand a leading ~ in path options (such as user-data-dir and extensions-dir) so they work in config.yaml the same way they do on the command line. Problem The shell expands ~ in command-line arguments, but nothing expands it in values read from the config file. With user-data-dir: ~/.config/code-server-data the value reaches path.resolve as-is (src/node/cli.ts#L469) and is resolved against the current working directory. Depending on where code-server is started, the result is /~/.config/code-server-data or /~/.config/..., which leads to errors like: Unable to read file '/~/.config/code-server-user-data/extensions/extensions.json' Solution As suggested in the issue ("it would be nice if we manually expand it when we read the config"), path options now go through a small expandTilde helper before path.resolve: ~ → the home directory ~/foo (or ~\foo on Windows) → /foo everything else, including ~user/... and a ~ in the middle of a path, is left unchanged Because the expansion happens in parse, it covers every option marked path: true (user-data-dir, extensions-dir, builtin-extensions-dir, cert, cert-key, socket, i18n), whether it comes from the CLI or the config file. CLI values are already expanded by the shell, so the change is a no-op for them. Changes File Change src/node/util.ts Add expandTilde() src/node/cli.ts Call expandTilde() before path.resolve() for path options test/unit/node/util.test.ts Unit tests for expandTilde() test/unit/node/cli.test.ts Test that parseConfigFile expands ~ in user-data-dir and extensions-dir Before / After config.yaml: user-data-dir: ~/.config/code-server-data Resolved user-data-dir (started from /srv) Before /srv/~/.config/code-server-data After /home//.config/code-server-data How to test Put user-data-dir: ~/.config/code-server-data in ~/.config/code-server/config.yaml. cd /tmp && code-server Check that the data directory is ~/.config/code-server-data in your home and that no /tmp/~ directory was created. Testing done New tests in util.test.ts and cli.test.ts cli and util unit test suites: 144/144 passing The new config test fails when expandTilde is a no-op, so it covers the bug prettier --check and eslint clean on the changed files Not tested on Windows (the ~\ branch is covered only by the path.sep check) Notes for reviewers ~user expansion is intentionally not supported; it would need a user database lookup and isn't what the issue asks for. Positional arguments (_) aren't path options and are unchanged.

Open Graph Description: Fixes #7051 Summary Expand a leading ~ in path options (such as user-data-dir and extensions-dir) so they work in config.yaml the same way they do on the command line. Problem The shell expands ~ i...

X Description: Fixes #7051 Summary Expand a leading ~ in path options (such as user-data-dir and extensions-dir) so they work in config.yaml the same way they do on the command line. Problem The shell expands ~ i...

Opengraph URL: https://github.com/coder/code-server/pull/8055

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.113.3

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:665fb117-7386-a27f-dcef-3c352b0d3ef7
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idABD0:1CEC4E:56BA06:79472C:6B0445A4
html-safe-nonce9ef41d9a933afcf47e90b8aa170bd593b1121bc8b36d3718a77df7352cda28e4
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQkQwOjFDRUM0RTo1NkJBMDY6Nzk0NzJDOjZCMDQ0NUE0IiwidmlzaXRvcl9pZCI6IjE5NjQ0Mzg3NDUwMDQ2NTYwMzYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmace284771f7b1a661949626caf2941f7ae3b39f013f03d957ca7cb77a2174081c0
hovercard-subject-tagpull_request:4854654870
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/coder/code-server/pull/8055/files
twitter:imagehttps://avatars.githubusercontent.com/u/155092207?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/155092207?s=400&v=4
og:image:altFixes #7051 Summary Expand a leading ~ in path options (such as user-data-dir and extensions-dir) so they work in config.yaml the same way they do on the command line. Problem The shell expands ~ i...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Noned4495c3631faba668036f176d1f5946901c5172efd73a6edb984029e7d4f8e46
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/coder/code-server git https://github.com/coder/code-server.git
octolytics-dimension-user_id95932066
octolytics-dimension-user_logincoder
octolytics-dimension-repository_id172953845
octolytics-dimension-repository_nwocoder/code-server
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id172953845
octolytics-dimension-repository_network_root_nwocoder/code-server
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release9ac4337fb7c6a5846cdfdb1a04f154d3c33ebc77
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/coder/code-server/pull/8055/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fcoder%2Fcode-server%2Fpull%2F8055%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fcoder%2Fcode-server%2Fpull%2F8055%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=coder%2Fcode-server
Reloadhttps://github.com/coder/code-server/pull/8055/files
Reloadhttps://github.com/coder/code-server/pull/8055/files
Reloadhttps://github.com/coder/code-server/pull/8055/files
coderhttps://github.com/coder
code-serverhttps://github.com/coder/code-server
Codehttps://github.com/coder/code-server
Issues147 (147)https://github.com/coder/code-server/issues
Pull requests15 (15)https://github.com/coder/code-server/pulls
Discussionshttps://github.com/coder/code-server/discussions
Actionshttps://github.com/coder/code-server/actions
Projectshttps://github.com/coder/code-server/projects
Security and quality3 (3)https://github.com/coder/code-server/security
Insightshttps://github.com/coder/code-server/insights
Sign up for GitHub https://github.com/signup?return_to=%2Fcoder%2Fcode-server%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fcoder%2Fcode-server%2Fissues%2Fnew%2Fchoose
code-asherhttps://github.com/code-asher
coder:mainhttps://github.com/coder/code-server/tree/main
harshbhx:fix/7051-expand-tilde-confighttps://github.com/harshbhx/code-server/tree/fix/7051-expand-tilde-config
Conversation 2 https://github.com/coder/code-server/pull/8055
Commits 1 https://github.com/coder/code-server/pull/8055/commits
Checks 13 https://github.com/coder/code-server/pull/8055/checks
Files changed https://github.com/coder/code-server/pull/8055/files
Please reload this pagehttps://github.com/coder/code-server/pull/8055/files
Expand ~ in path options from the config file https://github.com/coder/code-server/pull/8055/files#top
Show all changes 1 commit https://github.com/coder/code-server/pull/8055/files
7a9621f Expand ~ in path options from the config file harshbhx Oct 14, 2026 https://github.com/coder/code-server/pull/8055/commits/7a9621f1e5099b69bc29fe50e8537b3c665a7a9e
Clear filters https://github.com/coder/code-server/pull/8055/files
Please reload this pagehttps://github.com/coder/code-server/pull/8055/files
Please reload this pagehttps://github.com/coder/code-server/pull/8055/files
cli.ts https://github.com/coder/code-server/pull/8055/files#diff-e1f89aee8992fa7022cc43adb93042f9bbb4b223f0d6cd0e70719cf4b795afa4
util.ts https://github.com/coder/code-server/pull/8055/files#diff-8e0c46b152f3d9710115bb467980a690ffa07d39a4666db284f393c759f67168
cli.test.ts https://github.com/coder/code-server/pull/8055/files#diff-259502f3217ff57aa0efe8405a96d85558f638b6a1a27a3f772f7dda96ddc8f2
util.test.ts https://github.com/coder/code-server/pull/8055/files#diff-881b3614113f118dc48372c43448a3b5ab3a414b59f9c60cc310839104de4758
https://github.com/coder/code-server/blob/main/.github/CODEOWNERS#L1
src/node/cli.tshttps://github.com/coder/code-server/pull/8055/files#diff-e1f89aee8992fa7022cc43adb93042f9bbb4b223f0d6cd0e70719cf4b795afa4
View file https://github.com/harshbhx/code-server/blob/7a9621f1e5099b69bc29fe50e8537b3c665a7a9e/src/node/cli.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/coder/code-server/pull/8055/{{ revealButtonHref }}
https://github.com/coder/code-server/pull/8055/files#diff-e1f89aee8992fa7022cc43adb93042f9bbb4b223f0d6cd0e70719cf4b795afa4
https://github.com/coder/code-server/pull/8055/files#diff-e1f89aee8992fa7022cc43adb93042f9bbb4b223f0d6cd0e70719cf4b795afa4
https://github.com/coder/code-server/pull/8055/files#diff-e1f89aee8992fa7022cc43adb93042f9bbb4b223f0d6cd0e70719cf4b795afa4
https://github.com/coder/code-server/pull/8055/files#diff-e1f89aee8992fa7022cc43adb93042f9bbb4b223f0d6cd0e70719cf4b795afa4
https://github.com/coder/code-server/blob/main/.github/CODEOWNERS#L1
src/node/util.tshttps://github.com/coder/code-server/pull/8055/files#diff-8e0c46b152f3d9710115bb467980a690ffa07d39a4666db284f393c759f67168
View file https://github.com/harshbhx/code-server/blob/7a9621f1e5099b69bc29fe50e8537b3c665a7a9e/src/node/util.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/coder/code-server/pull/8055/{{ revealButtonHref }}
https://github.com/coder/code-server/pull/8055/files#diff-8e0c46b152f3d9710115bb467980a690ffa07d39a4666db284f393c759f67168
https://github.com/coder/code-server/blob/main/.github/CODEOWNERS#L1
test/unit/node/cli.test.tshttps://github.com/coder/code-server/pull/8055/files#diff-259502f3217ff57aa0efe8405a96d85558f638b6a1a27a3f772f7dda96ddc8f2
View file https://github.com/harshbhx/code-server/blob/7a9621f1e5099b69bc29fe50e8537b3c665a7a9e/test/unit/node/cli.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/coder/code-server/pull/8055/{{ revealButtonHref }}
https://github.com/coder/code-server/pull/8055/files#diff-259502f3217ff57aa0efe8405a96d85558f638b6a1a27a3f772f7dda96ddc8f2
https://github.com/coder/code-server/pull/8055/files#diff-259502f3217ff57aa0efe8405a96d85558f638b6a1a27a3f772f7dda96ddc8f2
https://github.com/coder/code-server/pull/8055/files#diff-259502f3217ff57aa0efe8405a96d85558f638b6a1a27a3f772f7dda96ddc8f2
https://github.com/coder/code-server/blob/main/.github/CODEOWNERS#L1
test/unit/node/util.test.tshttps://github.com/coder/code-server/pull/8055/files#diff-881b3614113f118dc48372c43448a3b5ab3a414b59f9c60cc310839104de4758
View file https://github.com/harshbhx/code-server/blob/7a9621f1e5099b69bc29fe50e8537b3c665a7a9e/test/unit/node/util.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/coder/code-server/pull/8055/{{ revealButtonHref }}
https://github.com/coder/code-server/pull/8055/files#diff-881b3614113f118dc48372c43448a3b5ab3a414b59f9c60cc310839104de4758
https://github.com/coder/code-server/pull/8055/files#diff-881b3614113f118dc48372c43448a3b5ab3a414b59f9c60cc310839104de4758
Please reload this pagehttps://github.com/coder/code-server/pull/8055/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlno-cache

Viewport: width=device-width


URLs of crawlers that visited me.