Home Download Buy Blog Forum Support

Disable automatic loading of last session

Disable automatic loading of last session

Postby jcamenisch on Sat Jan 28, 2012 11:20 pm

How can I tell Sublime not to open previously-open directories when I launch it? My ideal workflow would be

Code: Select all
$ cd path/where/I/want/to/work
$ subl .


After doing that, it's a pain to have to close other windows that come up automatically. I'm guessing there's a magic setting I can toggle somewhere?
jcamenisch
 
Posts: 2
Joined: Sat Jan 28, 2012 11:13 pm

Re: Disable automatic loading of last session

Postby jcamenisch on Sat Jan 28, 2012 11:42 pm

I figured it out. In Packages/User/Global.sublime-settings, the following lines got me what I want:

Code: Select all
{
  "hot_exit": false,
  "remember_open_files": false
}
jcamenisch
 
Posts: 2
Joined: Sat Jan 28, 2012 11:13 pm

Re: Disable automatic loading of last session

Postby iansane on Sat Jan 26, 2013 8:00 pm

Is it possible to change these setting from command line rather than editing the setting permanently in sublime?



For when I have 2 or 3 projects in sublime but want a new folder to open in sublime without those previous projects and don't want the new project to overwrite sublime_session when I close the window. That way when I open sublimetext normally it will still have those 2 or 3 other projects?

It seems simple from the command line perspective. Just a option to ignore last session and don't write session. But I don't know how difficult it would be to implement in sublime if it doesn't already exist.

Thanks
iansane
 
Posts: 8
Joined: Sun Nov 06, 2011 11:16 pm

Re: Disable automatic loading of last session

Postby constantius on Thu Jun 20, 2013 10:56 am

So, guys, any progress?

It really seems to be a tiny change — only add a command switch to 'subl' to ignore last session.
constantius
 
Posts: 2
Joined: Fri Mar 29, 2013 10:01 am

Re: Disable automatic loading of last session

Postby qgates on Thu Jun 20, 2013 2:16 pm

constantius wrote:So, guys, any progress?

It really seems to be a tiny change — only add a command switch to 'subl' to ignore last session.

+1

Such an option would make Sublime far more useful at the command-line for one-off file editing. Currently it's a workflow PITA:

Eg,

I have Sublime set as my editor for git. Every time I "git commit -a", Sublime opens with a bunch of tabs (and possibly windows).

Now,
Say I write my commit and then close with alt+f4, Git won't commit because I have another sublime window open and it's waiting for the process to quit, plus I've now broken my window collection from my last development session.

So I have to write my commit, then carefully save it, close the tab and then exit Sublime with File..Exit to keep my windows/projects as they were before. What a faff!

I've tried all kinds of workarounds for this, like loading a blank project with the cmdline etc., but none of them play nice. Blank projects have the annoying bug of launching a separate window, and randomly focusing it instead of the window with the file launched from the cmdline.

What we want here is a simple launch option that disables hot_exit, doesn't load any session/projects, and launches sublime in its own process for one-off editing. This would be dead handy for command line editing, but also for other purposes too, like making sublime the editor launched by other apps.

Sublime is beautiful, but it's doesn't play nice for people wanting to launch from the command line for one-off editing. As a result, I usually fall back to vim or whatever for those jobs.
qgates
 
Posts: 205
Joined: Mon Nov 05, 2012 4:33 pm


Return to Technical Support

Who is online

Users browsing this forum: Yahoo [Bot] and 18 guests