Sublime Forum

Saving open repo tabs?

#1

This is about the drive me crazy. All day long, I have 4 or 5 repos (in tabs) open at once and am popping back and forth between them. I will then inadvertently close Sublime Merge (via the window close button) and all my tabs are gone. I have to re-open them all next time I start.

Is there an option/setting to remember your open repo tabs and re-open them at launch?

1 Like

#2

Hi @ron1987,

Sorry to hear you’re having issues using Sublime Merge.
The repository tabs should definitely be saving between sessions.

To investigate this further:

  • What operating system are you using?
  • What version of Sublime Merge are you using?
  • How are you starting Sublime Merge (via shortcut, or via the command line etc). If starting via command line, are you providing any arguments to the command line helper?

Thanks,
- Dylan

0 Likes

#3

With SM 2034 on Windows 10 tabs are restored as long as SM is opened via shortcut or by executing sublime_merge.exe directly without command line arguments.

Tabs are not restored if SM is started via

a) “git status” indicator of ST’s statusbar.
b) “context menu” (e.g.: sublime_text.exe “c:\repo”)

If SM is already running, a new tab is added or an already open repo’s tab is selected.

Conclusion: Passing a repo name via command line args clears the open tabs.

As repos are organized in tabs (not single windows) it might be possible to reopen all tabs from the session and than add/select the one passed via command line arguments in order to maintain all tabs under all circumstances.

0 Likes

#4

Hah I thought this was a known bug. Anyway, can confirm, on Windows:

  • open SM and open a couple of tabs
  • close SM, open again (without arguments!): all tabs restored
  • close SM, now open it with arguments (e.g. from ST’s 'Open Git Repository): tabs not restored
0 Likes

#5

I am not sure whether it should really be named a bug. The behavior was designed when SM didn’t support tabs, thus executing SM with a repo passed via command line args was intended to not open dozens windows with previously opened repos. Instead only one window with the desired repository was to be displayed.

It’s the same with ST, which always restores all windows even though you might just want to have a quick view into a single file.

Things may have changed now that SM supports tabs. Restoring tabs may not be such a pain than having several windows’ popping up.

1 Like

#6

I get your point, but since SM does have tabs now, in my opinion the behavior should be changed or perhaps be made configurable. I.e. it is not exactly the same as ST, since it has the option of using the commandline swich -n if you just want to have a quick view into a file.

0 Likes

#7

I’m running on a Mac and I launch from the dock or by double-clicking on the .app. Build 2030.

0 Likes

#8

When you close an application using the window close button it doesn’t quit the application, it simply closes the window. So when you click on the app in the dock there’s nothing to restore as the application is still running, so it opens a new window for you. This is how all macOS applications work.

2 Likes

#9

@deathaxe’s summary of the current behavior is correct. The behavior when Sublime Merge is currently not running has changed a bit over the years. The history is as follows:

  • original behavior was to restore the previous session on smerge <path>
  • changed to not restore the previous session around build 1096 (see my original bug report)
  • went back to the original behavior in build 1201 or so
  • changed to not restoring in build 1202 due to this request
  • the behavior was questioned here and rejected as by-design

I’m not entirely sure why the behavior was changed or didn’t at least become an option similar to hot_exit in ST. I agree with @deathaxe that this could/should be revisited now that tabs are supported. Personally, I prefer the restoring behavior as I have 5 windows with 2-10 tabs in each window & hate having to manually restore them (therefore I force-quit to manually open & then re-run smerge <path>).

See also this thread and this bug report.

0 Likes

#10

For me it’s a feature, I like it :slight_smile:

1 Like

#11

Just to be clear, is not the current behaviour of sublime-merge (2059 over here) considered a bug?

Because the current behaviour is kind of destructive (therefore a bug). For instance, usually I try to open sublime_merge from the windows task bar so all my open repositories (aka session) will still be preserved (>10 repos usually), unfortunately sometimes I may forget to open sublime_merge from the very beginning and I’ll just open a particular new repo from SublimeText directly and If I do that, boom! all my tabs/sublime_merge session will be destroyed and I’ll have to open 1 by 1 all the sublime merge tabs again :frowning:

One simple solution that’d probably satisfy all users would be… open repository from sublime_text shouldn’t destroy all previous sublime_merge tabs and just set as active the opened tab repo (or append it at the end). And then, just give a context menu at the tab level with all the actions such as (close other tabs, close tabs to the right, etc etc…)

My 2 cents :slight_smile:

0 Likes

#12

As @bschaaf said, this is an issue inherent to how macOS handles closing the last window. Sublime Text and other apps like the Terminal behave the same. For a while, RedQuits has been solving this, but recently I noticed it did not do the job any more.

0 Likes