Hi everyone,
This is a definitive guide to solve a persistent and frustrating bug that occurs when using Cursor on Windows with a WSL (Windows Subsystem for Linux) backend.
The Problem
You’ve likely experienced one or more of these symptoms:
- The integrated terminal hangs or becomes unresponsive in Agent Mode.
- Long commands are garbled, truncated, or fail to execute.
- A strange
<
symbol appears at the beginning of your command, like<rt
or<thon
. - The issue is worse when commands contain multi-byte UTF-8 characters (e.g., in file paths or comments).
This bug is the root cause of issues reported in other threads, which were sometimes described unclearly. For example, it is the underlying problem in:
- Terminal Command Parsing Bug in Cursor – “<rt” Issue - The user mentioned “SSH” but the core issue was likely the faulty WSL connection, not SSH itself.
- Cursor failing to execute long commands - Described as “remoting into a linux environment”, which we can now confirm is specifically about the Cursor on Windows → WSL workflow.
The Root Cause: The Faulty WSL Bridge
The problem is not your shell, nor is it SSH. It’s the default communication bridge that Cursor uses to talk to the WSL environment. This bridge is fragile and corrupts commands before they even reach your shell.
The Solution: Use a Direct SSH Connection Instead
The solution is to stop using the default WSL integration and treat your WSL instance like a proper remote server. We will run Cursor’s own server component inside WSL and have the main Cursor app connect to it via a standard, stable SSH connection.
This bypasses the faulty bridge entirely.
How To Do It:
The workflow is simple:
1. Start the cursor-server
inside your WSL instance.
You need a running process inside WSL for Cursor to connect to. Open any terminal (Windows Terminal is great for this), get into your WSL, and run:
# First, ensure an SSH server is running in your WSL
sudo service ssh start
Keep this terminal window open. The server needs to stay active.
2. Connect to it from your main Cursor for Windows app.
Now, in your main Cursor window, connect to the server you just started.
- Press
Ctrl+Shift+P
and select Remote-SSH: Connect to Host… - Enter the connection string:
your-wsl-username@localhost
(e.g.,root@localhost
).
That’s it. A new Cursor window will open, running in a stable SSH session connected to your WSL.
With this setup, all terminal bugs will be gone. Interestingly, AugmentCode also failed to launch in the default WSL mode.