continue icon indicating copy to clipboard operation
continue copied to clipboard

IntelliJ: Windows → WSL remote not detected (only SSH detected)

Open shanevcantwell opened this issue 10 months ago • 6 comments

Description

When Windows IntelliJ connects to WSL, the extension does not detect this as a remote environment. Only SSH connections are detected.

Root Cause

In IntelliJIde.kt:145-148, remoteName is only set based on SSH environment variables:

var remoteName = "local"
if (sshClient \!= null || sshTty \!= null) {
    remoteName = "ssh"
}

WSL connections don't set these variables, so WSL is treated as "local" even though it's a remote Linux environment.

Impact

Any code that spawns processes based on platform detection will fail - same root cause as #9661 (VS Code) and #9151 (MCP servers).

Suggested Fix

Add WSL detection similar to the pattern used in PR #9679 for VS Code.

Related

  • #9661 - VS Code terminal ENOENT (fixed)
  • #9151 - MCP cmd.exe ENOENT in WSL
  • #9731 - Terminal output not captured

shanevcantwell avatar Jan 21 '26 06:01 shanevcantwell

Related issues:

  • #9151 - Continue VS Code extension fails to start MCP servers in WSL workspaces (looks for cmd.exe inside Ubuntu)
  • #9136 - @Git Diff context provider fails in WSL (Remote)
  • #9731 - Terminal output not captured when Windows VS Code connects to WSL
  • #9736 - CLI: runTerminalCommand has no remote/WSL detection
  • #9737 - shellPath.ts returns undefined for Windows even when connected to WSL

sestinj avatar Jan 21 '26 06:01 sestinj

@shanevcantwell was this fixed by one of these? https://github.com/continuedev/continue/pull/9810 https://github.com/continuedev/continue/pull/9740

RomneyDa avatar Jan 26 '26 23:01 RomneyDa

Analysis shows: PR #9810 only touched CLI files (extensions/cli/src/tools/) PR #9740 only touched core MCP files (core/context/mcp/) Neither touched IntelliJ code (extensions/intellij/ or the Kotlin files).

I'll take a look now.

shanevcantwell avatar Jan 27 '26 00:01 shanevcantwell

This was based on a code pattern that related to those two bugs. In trying to repro in IntelliJ, I saw that the extension there has the same problem as VSCode: Issue #4691

Because the state across windows is shared, not uniwue, if I have two windows open in VSCode (and I typically have at least that many), and they mix wsl and native Windows, the lack of state isolation across IntelliJ or VSCode windows makes the Continue extension not know whether to serve up wsl or powershell. This problem is the same in IntelliJ. as in VSCode. (though not cross-product)

Look at this image. The left window I opened explicitly through wsl, and IntelliJ's terminal gives me a *nix terminal and path. In the extension, my rnj-1 model here is showing the current folder through Powershell path (which is the pattern #9810 and #9740 fixed and predicted for here: powershell when in wsl Ubuntu). In the right window I started a new project on the DOS side and ran pwd again through the extension.

Image

Below is upon opening a 3rd window, now through wsl again. The image shows: before opening a file, it still thinks it's in window 2. Once I open a file through that wsl window, though, the extension returns to the original powershell::wsl shell and path.

Image

shanevcantwell avatar Jan 27 '26 01:01 shanevcantwell

This issue hasn't been updated in 90 days and will be closed after an additional 10 days without activity. If it's still important, please leave a comment and share any new information that would help us address the issue.

github-actions[bot] avatar May 27 '26 02:05 github-actions[bot]

This issue was closed because it wasn't updated for 10 days after being marked stale. If it's still important, you are welcome to leave a comment and this will keep the issue open. However please note that this repo is no longer being actively maintained.

github-actions[bot] avatar Jun 07 '26 02:06 github-actions[bot]