Problem
Two related complaints about file saving in IntelliJ Platform IDEs (CLion, IntelliJ IDEA, PhpStorm, PyCharm, Rider, WebStorm and others):
- Autosave cannot be turned off. Settings | Appearance & Behavior | System Settings states "Autosave cannot be disabled completely".
- Changes an external process writes to a file are lost without warning. The sequence runs like this: an unsaved edit sits in the editor buffer, and an external tool rewrites the same file on disk. The IDE then writes the stale buffer over the new content when the editor tab or the IDE closes. This became common with AI coding agents, because an agent rewrites whole files while the IDE holds them open.
Cause
Autosave triggers fall into two groups. Two are configurable: a save on focus loss, and a save after an idle interval. The rest stay active regardless of settings. They cover closing an editor tab, closing the project, exiting the IDE, running a build, and most version control operations. Making autosave fully optional is not planned.
The overwrite is a separate mechanism. MemoryDiskConflictResolver raises the File Cache Conflict dialog on a file-content change event that did not originate from a save. It raises the dialog only while a cached document for that file still holds unsaved edits. The trigger is a refresh of the virtual file system, not a save. When nothing refreshes the file between the external write and the IDE's own save, no conflict is detected and the buffer is written out silently.
Resolution
- Remove the two configurable autosave triggers. In Settings | Appearance & Behavior | System Settings, clear Save files when switching to a different application or a built-in terminal and Save files if the IDE is idle for N seconds.
- Keep external-change detection on. On the same page, under Sync external changes, enable When switching to the IDE window or opening an editor tab. The checkbox gives the IDE a reason to refresh the file. That refresh is the precondition for the File Cache Conflict dialog appearing instead of a silent overwrite.
- Discard an unsaved edit with Ctrl+Z, or with Local History for anything older than the undo stack. No "close without saving" action exists.
Both behaviors are tracked publicly:
- Safely and intelligently merge external file changes with unsaved user edits: safely merge external file changes with unsaved user edits. Open, planned for 2026.3. The planned design is automatic merging with an inline conflict resolver, not a modal Save/Discard dialog.
- Confirm save file on tab close or application exit: confirm save on tab close or application exit. Open since 2012, 85 votes.
Star or vote on either issue to be notified when it moves.
Comments
0 comments
Please sign in to leave a comment.