12

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 3

14

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 []
2
  • 2
    I had to use 2 other keys because opened-files wasn't there: opened-files-view2 & opened-files-view1
    – MegaTux
    Aug 10, 2017 at 18:44
  • 1
    With 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
5

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.

  1. What lewis suggested, removing previously opened files, which results scratch to open welcome screen (I mean default one), but retain "last-tabs" behavior.

  2. 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.

2
  • I am assuming this does the trick (haven't tested), but could you explain how this works?
    – RolandiXor
    Jan 13, 2016 at 17:29
  • @RolandiXor I have edited my answer and let me know, if you need further clarification(s) :)
    – Ravan
    Jan 14, 2016 at 2:12
4

Just in case someone runs into this on Juno:

gsettings set io.elementary.code.settings opened-files-view1 "[]"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.