From a38fc81a583c889d8564c7065ab5b5efddfd2573 Mon Sep 17 00:00:00 2001 From: eswaldots Date: Sun, 16 Feb 2025 15:34:53 +0000 Subject: [PATCH] Fix encryption service dont working on Linux --- .../encryption/electron-main/encryptionMainService.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/vs/platform/encryption/electron-main/encryptionMainService.ts b/src/vs/platform/encryption/electron-main/encryptionMainService.ts index 1b4b1e05..c7fa13d9 100644 --- a/src/vs/platform/encryption/electron-main/encryptionMainService.ts +++ b/src/vs/platform/encryption/electron-main/encryptionMainService.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import { safeStorage as safeStorageElectron, app } from 'electron'; -import { isMacintosh, isWindows } from '../../../base/common/platform.js'; +import { isMacintosh, isWindows, isLinux } from '../../../base/common/platform.js'; import { KnownStorageProvider, IEncryptionMainService, PasswordStoreCLIOption } from '../common/encryptionService.js'; import { ILogService } from '../../log/common/log.js'; @@ -23,6 +23,11 @@ export class EncryptionMainService implements IEncryptionMainService { constructor( @ILogService private readonly logService: ILogService ) { + if (isLinux && !app.commandLine.getSwitchValue('password-store')) { + this.logService.trace('[EncryptionMainService] No password-store switch, defaulting to basic...'); + app.commandLine.appendSwitch('password-store', PasswordStoreCLIOption.basic); + } + // if this commandLine switch is set, the user has opted in to using basic text encryption if (app.commandLine.getSwitchValue('password-store') === PasswordStoreCLIOption.basic) { this.logService.trace('[EncryptionMainService] setting usePlainTextEncryption to true...');