Whenever I try and open Scratch, it tries to load the files I previously had open. While I want to keep the behaviour, one of the files I opened was an SVG of several MBs. As a result, Scratch now hangs and eventually crashes every time I open it.
3 Answers
You can view your currently open files with
gsettings get org.pantheon.scratch.settings opened-files
['file:///home/lewis/image.svg']
You can clear your currently open files by setting the same key as an empty list.
gsettings set org.pantheon.scratch.settings opened-files []
-
2I had to use 2 other keys because opened-files wasn't there: opened-files-view2 & opened-files-view1– MegaTuxAug 10, 2017 at 18:44
-
1With scratch in loki, found that the key must be qualified with the view as in "-view1". This is discovered by exploring to the same setting path with dconf editor and observing the current settings. Oct 11, 2017 at 17:48
This is only an alternative, Lewis answer is the accurate one.
To clear currently opened files:
Open scratch --> settings --> preferences --> Behavior --> Show Welcome Screen.
If you are not able to open scratch, open terminal and run:
gsettings set org.pantheon.scratch.settings show-at-start welcome
The problem here is because scratch stores previously opened files.
There you have two (may be more) possible workarounds.
What lewis suggested, removing previously opened files, which results scratch to open welcome screen (I mean default one), but retain "last-tabs" behavior.
What I have suggested, directly changing to welcome screen (Alternative), but "last-tabs" behavior will change. Since OP wants to have the "Show last open tabs" behavior, he can change once he open scratch.
In both the cases the previously opened files be ignored and scratch open with welcome screen.
In any case the point is opening scratch without crashing.
-
I am assuming this does the trick (haven't tested), but could you explain how this works? Jan 13, 2016 at 17:29
-
@RolandiXor I have edited my answer and let me know, if you need further clarification(s) :)– RavanJan 14, 2016 at 2:12
Just in case someone runs into this on Juno:
gsettings set io.elementary.code.settings opened-files-view1 "[]"