Tab Variables Persistence

I'm setting some tab variables and persisting them. When I do an Exit Directory Opus, their persistence is remembered but if I close the window and open it again, the persistence is lost. I want to keep this persistence regardless of how I close the window.

I do work with only one Directory Opus window. Closing the Window is more preferred approach as its quicker to close (no prompt) and should be quicker to launch as well. It appears that Exit Directory Opus does some additional treatment for tab variable persistence which is missing if I just close the window instead.

Also, I don't see the option to shutdown DOpus when last window closes. How to Exit Directory Opus

You may just need to turn on:

Preferences / Layouts and Styles / Default Lister:

  • Update Default Lister automatically when closing a Lister

Tab variables will be saved with a window or layout, but they're also inherently ephemeral, like the tabs and windows themselves. If you have state that you want to store permanently, tab variables may not be the best choice. (Depending on what the state is for, of course.)

I have that setting to on already. I am setting the locked path as a variable and it needs to be saved on per tab basis until the tab is closed (but surviving restarts). I understand that the tab objects would be recreated on subsequent launches. I see that it isn't a problem when Exit Directory Opus is used.

On second thoughts, I think its not the exit but the launch that is causing a different behaviour. When I launch after an Exit Directory Opus, i see a log Main process started. and this is what seems to be loading the tab variables. I don't see such log if I close the window and reopen it. And subsequently, those variables are lost as the tabs are created without these variables.

When you open a new window, is it the Default Lister you’re opening or something else? (E.g. a layout.)

Summarized below

Additionally, I tried enabling automated shutdown, but even that doesn't restore the persisted tabs variable.

The default lister is updated on close but likely it doesn't persist the variables. It's a mystery how the green behaviour works then. It even survives persistent tab variables across Windows restart.

Can I use a run command to trigger the green behavior?

And as another test, if I close the lister (not shutting down DOpus), restart Windows and then start DOpus, the variables aren't persisted.

In summary, the tab variables are persisted only if I manually Shutdown DOpus and then start it. Closing lister or automated shutdown of DOpus doesn't persist them. How can I persist them even when closing the last lister.

Close PROGRAM=onlast
Close PROGRAM=confirm

These two commands persist the tab variables. Can I modify the window close icon to trigger this command instead?

Achieved with this. I wished there was a cleaner way though.

function OnCloseLister(closeListerData) {
	// Don't interrupt shutdown
	if (closeListerData.shutdown) {
		return false;
	// Close normally if more than 1 lister is open
	if (DOpus.listers.count > 1) {
		return false;
	// Return false to interrupt the earlier close and issue correct close command
	DOpus.CreateCommand.RunCommand("Close PROGRAM=onlast");
	return true;

We'll have a fix for this in 13.3.1. Thanks for the report!

Thanks. This is now remembered even without a full shutdown of DOpus.

1 Like