Terminal commands stuck/failed on Remote SSH with ENOENT spawn zsh error

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

Problem
When using Cursor with Remote SSH to connect to a Linux server, terminal commands get stuck or fail silently. No useful error is shown in the terminal UI itself.
By opening Cursor Developer Tools (Help > Toggle Developer Tools), I found the following error in the console:
code: ‘ENOENT’, syscall: ‘spawn zsh’, path: ‘zsh’
This happens because my local macOS uses zsh as the default shell, and Cursor carries this shell preference over to the remote session. However, zsh is not installed on the remote Linux machine, causing the spawn to fail.

Steps to Reproduce

Local OS: macOS (default shell: zsh)
Remote OS: Linux (only bash available, no zsh installed)
Connection: Remote SSH

Expected Behavior

auto switch to use remote bash terminal

Operating System

MacOS

Version Information

Version: 2.4.31
VSCode Version: 1.105.1
Commit: 3578107fdf149b00059ddad37048220e41681000
Date: 2026-02-08T07:42:24.999Z
Build Type: Stable
Release Track: Default
Electron: 39.2.7
Chromium: 142.0.7444.235
Node.js: 22.21.1
V8: 14.2.231.21-electron.0
OS: Darwin arm64 24.6.0

Additional Information

Solution
Step 1: Change the default terminal profile for the remote host
Open Settings (Cmd + , on macOS / Ctrl + , on Windows/Linux).
Important: Switch the settings scope to Remote [SSH: your.remote.host] (top-right dropdown), not Local or User.
Search for terminal default profile linux.
Set Terminal > Integrated > Default Profile: Linux to bash (or whichever shell is available on your remote machine).
Step 2: Restart the remote Cursor Server
After changing the setting, the issue may persist until you restart the remote cursor-server process. Simply reconnecting is not enough.
Run the following on the remote machine:
ps -ef | grep -i cursor-server | grep -v grep | awk ‘{print $2}’ | xargs -I {} kill -9 {}
Then close Cursor completely and reconnect to the remote host. The terminal should now work correctly.
Environment
Local OS: macOS (default shell: zsh)
Remote OS: Linux (only bash available, no zsh installed)
Connection: Remote SSH

Does this stop you from using Cursor

Sometimes - I can sometimes use Cursor

This looks like you’ve already got the full solution worked out — the Remote [SSH] settings scope for terminal profile plus the cursor-server restart. That’s exactly right.

One thing I’d add: you can avoid manually killing cursor-server by using the Remote-SSH: Kill VS Code Server on Host command from the command palette (Cmd+Shift+P). It’s cleaner than kill -9 and properly shuts down the server.

Also, if you’re frequently switching between remote hosts with different shells, you can set "terminal.integrated.defaultProfile.linux": "bash" in your User settings as a fallback. The remote-specific settings will still override when present, but this prevents the issue on new connections where you haven’t configured it yet.


Delimit · dev problems deserve fast answers · AI-suggested, corrections welcome

Hey, thanks for the detailed report and for including a workaround. That’ll definitely help other users who run into the same issue.

The team is aware of a problem where Cursor carries local shell settings over to remote hosts where that shell isn’t installed.

The community tip above about using the Remote-SSH command palette action Kill VS Code Server on Host is a great option. It’s cleaner than killing processes manually. Also, setting "terminal.integrated.defaultProfile.linux": "bash" in your user settings as a general fallback is a good proactive step.

Ideally, Cursor should automatically detect an available shell on the remote machine instead of blindly applying local preferences. I’ve passed this along.

This topic was automatically closed 22 days after the last reply. New replies are no longer allowed.