File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -277,7 +277,13 @@ export class Remote {
277277 const parsed = jsonc . parse ( settingsContent )
278278 parsed [ "remote.SSH.remotePlatform" ] = remotePlatforms
279279 const edits = jsonc . modify ( settingsContent , [ "remote.SSH.remotePlatform" ] , remotePlatforms , { } )
280- await fs . writeFile ( this . storage . getUserSettingsPath ( ) , jsonc . applyEdits ( settingsContent , edits ) )
280+ try {
281+ await fs . writeFile ( this . storage . getUserSettingsPath ( ) , jsonc . applyEdits ( settingsContent , edits ) )
282+ } catch ( ex ) {
283+ // The user will just be prompted instead, which is fine!
284+ // If a user's settings.json is read-only, then we can't write to it.
285+ // This is the case when using home-manager on NixOS.
286+ }
281287
282288 const workspaceUpdate = new vscode . EventEmitter < Workspace > ( )
283289 const watchURL = new URL ( `${ this . storage . getURL ( ) } /api/v2/workspaces/${ this . storage . workspace . id } /watch` )
You can’t perform that action at this time.
0 commit comments