@@ -174,6 +174,24 @@ export async function createRules(repository?: Repository) {
174174 }
175175}
176176
177+ /**
178+ * Detects if the current environment is running in Windows Subsystem for Linux (WSL)
179+ * @returns boolean indicating if the current environment is WSL
180+ */
181+ export function isRunningInWsl ( ) : boolean {
182+ if ( os . platform ( ) !== 'linux' ) {
183+ return false
184+ }
185+
186+ try {
187+ const osReleaseContent = fs . readFileSync ( '/proc/version' , 'utf8' )
188+ return osReleaseContent . toLowerCase ( ) . includes ( 'microsoft' ) || osReleaseContent . toLowerCase ( ) . includes ( 'wsl' )
189+ } catch {
190+ // If we can't read the file, assume it's not WSL
191+ return false
192+ }
193+ }
194+
177195function getCurrentIDE ( ) : string {
178196 const isCursor = vscode . env . appName . toLowerCase ( ) . includes ( 'cursor' )
179197 const isWindsurf = vscode . env . appName . toLowerCase ( ) . includes ( 'windsurf' )
@@ -204,16 +222,12 @@ function getCorrectMcpConfig(): {
204222 // Get platform-specific VS Code settings directory
205223 let vsCodeSettingsPath : string
206224
207- switch ( process . platform ) {
208- case 'darwin' : // macOS
209- vsCodeSettingsPath = path . join ( os . homedir ( ) , 'Library' , 'Application Support' , 'Code' , 'User' )
210- break
211- case 'win32' : // Windows
212- vsCodeSettingsPath = path . join ( os . homedir ( ) , 'AppData' , 'Roaming' , 'Code' , 'User' )
213- break
214- default : // Linux and others
215- vsCodeSettingsPath = path . join ( os . homedir ( ) , '.config' , 'Code' , 'User' )
216- break
225+ if ( process . platform === 'win32' || isRunningInWsl ( ) ) {
226+ vsCodeSettingsPath = path . join ( os . homedir ( ) , 'AppData' , 'Roaming' , 'Code' , 'User' )
227+ } else if ( process . platform === 'darwin' ) {
228+ vsCodeSettingsPath = path . join ( os . homedir ( ) , 'Library' , 'Application Support' , 'Code' , 'User' )
229+ } /* Linux */ else {
230+ vsCodeSettingsPath = path . join ( os . homedir ( ) , '.config' , 'Code' , 'User' )
217231 }
218232
219233 return {
0 commit comments