.bashhistory is removed when reconnecting to SSH

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

When I startup my Cursor IDE and it reconnects to my external SSH server, It often runs “rm -f .bash_history” on my server upon reconnecting.

This is unexpected behaviour which is not ideal, but also it keeps getting flagged to my company’s IT security and I recieve many emails and direct messages about it by individuals worried that some malicious behaviour has been attempted to be hidden.

Steps to Reproduce

I am using Windows for my machine, Linux for the external ssh server

Setup command monitoring on your ssh server
Connect your machine to a ssh server with cursor IDE
Do some work, call some agents, etc
Restart your machine (perhaps without cleanly disconnecting from SSH)
Reconnect your machine to an ssh server with cursor IDE

Expected Behavior

bash history is not deleted

Operating System

Windows 10/11

Current Cursor Version (Menu → About Cursor → Copy)

Version: 2.1.47 (system setup)
VSCode Version: 1.105.1
Commit: 2d3ce3499c15efd55b6b8538ea255eb7ba4266b0
Date: 2025-12-04T02:31:50.567Z
Electron: 37.7.0
Chromium: 138.0.7204.251
Node.js: 22.20.0
V8: 13.8.258.32-electron.0
OS: Windows_NT x64 10.0.26100

For AI issues: which model did you use?

Auto

Additional Information

This does not stop me from using Cursor now, but it could be blacklisted my organization in the future

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey, thanks for the report. This is definitely unexpected behavior. Cursor shouldn’t delete .bash_history on a remote server.

To investigate, we’ll need some diagnostics:

  1. SSH extension logs: Open the Output panel (View > Output), pick “Remote - SSH” from the dropdown, and copy the logs starting from the reconnect.

  2. Check extensions: Go to Settings > Application > Experimental > Extension Monitor Enabled, then run CTRL + Shift + P > Developer: Open Extension Monitor. Which extensions are active during the SSH connection?

  3. Test without extensions: Run cursor --disable-extensions from the command line, connect via SSH, and check if the issue still happens.

  4. Shell configs: Can you share the contents of ~/.bashrc, ~/.bash_profile, and ~/.profile on the remote server? There might be hooks there that trigger on SSH reconnect.

This should help us figure out whether it’s an issue with the SSH extension, another extension, or the server’s shell configuration.

Ah, I feel silly now! It seems it was in my .profile (The only one i didn’t check!) - I’m not sure how it got there, but there’s nothing to say it was Cursor.

Thank you for the debug steps. I was unaware of the Extension Monitor. That will be useful in the future.

Thanks again

1 Like

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