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)
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:
SSH extension logs: Open the Output panel (View > Output), pick “Remote - SSH” from the dropdown, and copy the logs starting from the reconnect.
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?
Test without extensions: Run cursor --disable-extensions from the command line, connect via SSH, and check if the issue still happens.
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.