I’ve figured this one out; the distractionFree command in /Default/DistractionFree.py uses the drawcentred option to determine if distractionfree mode is currently running. Since I always run sublime in centred mode, the plugin always thinks I’ve got distractionfree mode on, and running the command attempts to turn it off again. Which exits fullscreen mode and puts all the furniture back.
The fix is to add in an extra property to distinguish distractionfree from not;
import sublime, sublimeplugin
class DistractionFreeCommand(sublimeplugin.TextCommand):
def run(self, view, args):
if not view.options().get('distractionfree'):
view.options().set('distractionfree', True)
...]
else:
# Drop the explicit options previously set, letting the defaults
# show through.
view.options().erase('distractionfree')
...]