Skip to content

feat: Add Windows WSL [Ubuntu] Agent Shell Support for Intellij -- Code and Generic Terminal/Bash Execution#12442

Open
GabeChurch wants to merge 5 commits into
continuedev:mainfrom
GabeChurch:intellij-wsl-feats
Open

feat: Add Windows WSL [Ubuntu] Agent Shell Support for Intellij -- Code and Generic Terminal/Bash Execution#12442
GabeChurch wants to merge 5 commits into
continuedev:mainfrom
GabeChurch:intellij-wsl-feats

Conversation

@GabeChurch
Copy link
Copy Markdown

@GabeChurch GabeChurch commented May 19, 2026

Add support for Intellij on Windows Agents using Windows Subsystem For Linux (WSL) and add user facing test(s) supporting multiple Intellij version ranges

Description

The Problem

The current IntelliJ continue plugin fails to support agent code execution -- happening via the runTerminalCommand -- when opening a notebook in the Windows Subsystem for Linux (Ubuntu) filesystem. This prevents agents from doing almost anything useful when using IntelliJ on WSL. IntelliJ itself supports WSL based projects, and even changes the terminal to use Ubuntu instead of windows which is incredibly useful for engineers who preferer require multiple isolated environments, use separate WSL backends to manage dependencies, or even want a separate isolated development environment to run agents on. The current behavior for agents used in WSL notebooks is to default to powershell commands, which means agents cannot execute code in the same isolated environment as the user and code -- making them quite less useful.

The Solution

  • Modified the resolveWorkingDirectories in the core tools "runTerminalCommand.ts" to add a new cwd and shell check that ONLY triggers on IntelliJ Notebooks that are opened from the Windows Subsystem For Linux. A lightweight file path check to correctly identify the desired WSL environment and pass it through is triggered before getShellCommand logic
  • Modified the getShellCommand in the core tools "runTerminalCommand.ts" to identify the passthrough cwd when it is WSL, and even dynamically parse out the correct or custom Kernel to use (in the case of multiple separate WSL backends with differing names). This can only affect windows IntelliJ users because vscode uses a separate backend for WSL (that is still correctly identified as a remote server), a two part fix was required to maintain the existing plugin architecture.

User Info

If you stumbled across this as an IntelliJ user, you don't need to set anything for this change to work for you. To debug any issues with the continue plugin on WSL with Intellij yourself I suggest launching like this from a windows command prompt -- this forces legacy "wsl$" instead of default "wsl.localhost" in the path which may resolve some bugs you could experience.

  • Change your jetbrains path to match your install.
  • Change Ubuntu to your wsl linux distribution (note it must support bash)
"C:\Program Files\JetBrains\IntelliJ IDEA 2026.2\bin\idea64.exe" \\wsl$\Ubuntu\home\<yourusername>\<YourIntellijProject>

AI Code Review

  • Team members only: AI review runs automatically when PR is opened or marked ready for review
  • Team members can also trigger a review by commenting @continue-review

Checklist

  • I've read the contributing guide
  • The relevant docs, if any, have been updated or created
  • The relevant tests, if any, have been updated or created

Screen recording or screenshot

This example shows the new tests being used to run the new Ubuntu agent execution feature as well as the existing Powershell agent and each respectively running bash and powershell code depending on whether they are in standard windows or WSL Ubuntu.

Continue_Plugin_Ubuntu_WSL_Support_Tests.mp4

Tests

I created a new "Run Continue WSL" configuration/test, added for both CE and Ultimate distributions of IntelliJ, that allows any standard windows user to launch the existing manual-testing-sandbox testing Intellij sample project and select a WSL backend in addition to the standard test (which can be any WSL custom name in the "Run Continue WSL (use TCP).run.xml file -- defaults to "Ubuntu", the base/standard WSL distribution). This can be used as a future test to validate any WSL related functionality in Intellij.

image

Detailed Test Breakdown

I identified a slightly frustrating behavior with the current gradle.properties Intellij 2024.1, where it cannot directly launch notebooks using WSL backend(s) with files located in standard windows C path, which makes testing more painful. To solve for this I added a gradle.properties check that will automatically do this "optimal path" in 2025 and newer major versions (same physical test files used to launch). With the current 2024 major version test I solved for this by copying the test files to a WSL "tmp" location at test launch (before the actual launch happens). I also added and validated a "postLaunch/shutdown" hook that cleans these temp files no matter how shutdown is called. In this way nothing appears no different to users testing -- although it is recommended to them to setup the continue config.yaml file in standard windows before running the WSL test.

Dependencies

If you want to run this test you need to have a windows subsystem for linux installed and enabled + IntelliJ.

Suggested is to install Ubuntu from the Microsoft Store which is the default
image

Configuration [Only required for TESTING]

If you use something other than "Vanilla" Ubuntu in your Windows Subsystem for Linux, you can change the test to use it instead of the default.

image

The change is an environment variable matching your WSL distribution name.
image

If you are unsure you can find it in the file browser under "Linux"

Related


I have read the CLA Document and I hereby sign the CLA

… Subsystem For Linux (WSL) and add user facing test(s) supporting multiple Intellij version ranges
@GabeChurch GabeChurch requested a review from a team as a code owner May 19, 2026 23:50
@dosubot dosubot Bot added the size:L This PR changes 100-499 lines, ignoring generated files. label May 19, 2026
@github-actions
Copy link
Copy Markdown
Contributor


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 5 files

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread extensions/intellij/build.gradle.kts Outdated
Comment thread extensions/intellij/build.gradle.kts
@GabeChurch
Copy link
Copy Markdown
Author

GabeChurch commented May 20, 2026

I have read the CLA Document and I hereby sign the CLA

I have read the CLA Document and I hereby sign the CLA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L This PR changes 100-499 lines, ignoring generated files.

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

1 participant