You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unmounting a mount containing a file being edited by Code does not result in a "busy" warning #1813
Unmounting a mount containing a file being edited by Code does not result in a "busy" warning
Steps to Reproduce
Mount e.g. a USB stick
Open a text file on that mount with Code
Ensure "Save files when changed" s OFF
Make some changes
Unmount the mount using Files (latest source)
No warning is given that the mount is in use by Code
Expected Behavior
A user might expect to get a warning in this situation (although other text editors do not hold files open on the mount under similar circumstances either).
Fortunately Code handles the situation gracefully and gives the user the opportunity to save the file elsewhere or remount.
The desired behaviour is uncertain and suggestions are invited.
Hi, I tried to reproduce this problem and found a few interesting interactions.
If the file opened in Code has not been modified, Code immediately closes the file when the mount is ejected (without any warnings).
If the file opened in Code was modified but not saved, Code will show a dialog when the mount is ejected. However, the "Save Duplicate" button keeps reopening the same dialog and the "Ignore" button closes the dialog and leaves the modified file open.
Screenshot of "Save Duplicate" dialog
Further attempts to close Code or the file will display a dialog asking if the user wants to save the file. The "Save" button reopens the "Save Duplicate" dialog (which does not work), and the "Close without saving" button closes the file without saving it. If you choose "Save Duplicate" now, the entire DE crashes and restarts.
Screenshot of "Close without saving" dialog
So, I wouldn't say that Code handled this situation gracefully given that the user cannot save the file elsewhere.
P.S. This is my first time contributing to this project, please provide any feedback or things I can do to make the comment more helpful :)
@kahhong Thanks for the extra information. You are right - there is an issue with Code under some circumstances - the Save Duplicate button does not work as expected. I will raise an issue in the Code project and get it fixed.
Activity
kahhong commentedon Sep 8, 2026
OS Version
8.1 (Circe)
Code version
Code 8.3.2
Files version
io.elementary.files 7.3.2
Hi, I tried to reproduce this problem and found a few interesting interactions.
If the file opened in Code has not been modified, Code immediately closes the file when the mount is ejected (without any warnings).
If the file opened in Code was modified but not saved, Code will show a dialog when the mount is ejected. However, the "Save Duplicate" button keeps reopening the same dialog and the "Ignore" button closes the dialog and leaves the modified file open.
Screenshot of "Save Duplicate" dialog
Further attempts to close Code or the file will display a dialog asking if the user wants to save the file. The "Save" button reopens the "Save Duplicate" dialog (which does not work), and the "Close without saving" button closes the file without saving it. If you choose "Save Duplicate" now, the entire DE crashes and restarts.
Screenshot of "Close without saving" dialog
So, I wouldn't say that Code handled this situation gracefully given that the user cannot save the file elsewhere.
P.S. This is my first time contributing to this project, please provide any feedback or things I can do to make the comment more helpful :)
jeremypw commentedon Sep 8, 2026
@kahhong Thanks for the extra information. You are right - there is an issue with Code under some circumstances - the Save Duplicate button does not work as expected. I will raise an issue in the Code project and get it fixed.