Session restore restores deleted/temporary files
System information
What is your operating system and version? Arch Linux
What is the version of GNOME Text Editor? 44.0
If the bug caused data loss, where was the file located? n/a
Text Editor (44.0)
GLib: 2.76.4 (2.76.3)
GTK: 4.12.1 (4.10.4)
GtkSourceView: 5.8.0 (5.8.0)
Libadwaita: 1.3.4 (1.3.3)
Enchant2: 2.5.0
gtk-theme-name: Adwaita-empty
GTK_THEME: unset
GdkDisplay: GdkWaylandDisplay
Documents Directory: /home/elomatreb/Documents
org.gnome.TextEditor restore-session = true
org.gnome.TextEditor recolor-window = true
org.gnome.TextEditor show-map = false
org.gnome.TextEditor custom-font = 'Monospace 11'
org.gnome.TextEditor show-line-numbers = true [default=false]
org.gnome.TextEditor style-scheme = 'Adwaita-dark' [default='Adwaita']
org.gnome.TextEditor wrap-text = true
org.gnome.TextEditor style-variant = 'follow'
org.gnome.TextEditor indent-style = 'tab'
org.gnome.TextEditor show-right-margin = false
org.gnome.TextEditor spellcheck = true
org.gnome.TextEditor auto-indent = true
org.gnome.TextEditor use-system-font = true
org.gnome.TextEditor keybindings = 'default'
org.gnome.TextEditor highlight-current-line = false
org.gnome.TextEditor last-save-directory = ''
org.gnome.TextEditor auto-save-delay = uint32 3
org.gnome.TextEditor discover-settings = true
org.gnome.TextEditor enable-snippets = false
org.gnome.TextEditor line-height = 1.2
org.gnome.TextEditor indent-width = -1
org.gnome.TextEditor show-grid = false
org.gnome.TextEditor draw-spaces = @as []
org.gnome.TextEditor right-margin-position = uint32 80
org.gnome.TextEditor tab-width = uint32 8
Have you tested Nightly to see if the issue has been fixed? Yes, same behavior.
Bug information
Steps to reproduce
- Open a file in Text Editor and add some content.
- Close the editor, e.g. by clicking the X.
- Delete the file.
- Reopen Text Editor.
- The file is restored as an empty tab.
Current behaviour
The file is restored even when it doesn't exist anymore and without any indication that it does not exist (aside from being empty). This is especially noticeable when using Text Editor to open temporary files (e.g. from an archive viewer).
Expected behaviour
I would expect deleted files not to be restored. The interaction with the temporary files described above leads to empty editor tabs accumulating for no reason.