Page 1 of 1

close last Tab

Posted: 27 Jan 2021 09:36
by 7iben
Is it possible that the last open tab also gets an X-close button? If you then press it, the path of the set New Tab should be opened in this tab. That would be fantastic. Or is that already possible somehow?

Re: close last Tab

Posted: 27 Jan 2021 09:59
by RalphM
What?
Depending on your config setting, each tab will have a X-close button.
Why close a tab if you want to open it again?
You might have to explain your wish a bit more (at least for me, maybe someone else gets it).

Re: close last Tab

Posted: 27 Jan 2021 10:07
by highend
The last (the only one existing) tab doesn't have a close button by design.

What you want can be achieved via a custom event action though.

At least if you're fine with either double/middle clicking on a tab or double clicking on the white space in the tab bar.

So, are you?

Re: close last Tab

Posted: 27 Jan 2021 10:19
by 7iben
yes double/middle clicking on a tab or double clicking on the white space in the tab bar is ok.
What do I have to do?

Re: close last Tab

Posted: 27 Jan 2021 10:30
by highend
Configuration | General | Custom Event Actions

Choose one that you want (from those I mentioned) and choose "Run script" as the action for it.

Code: Select all

    if (gettoken(get("tabs"), "count", "|") == 1) {
        $ini  = "%TEMP%\~XY.ini"; savesettings 1, $ini;
        $path = getkey("StartPathNewTab", "Settings", $ini);
        if ($path) {
            $tabFlags = tab("get", "flags");
            // Locked tab?
            if ($tabFlags == 1) {
                tab("lock", 0);
                goto $path;
                tab("lock", 1);
            } else { goto $path; }
        }
    }

Re: close last Tab

Posted: 27 Jan 2021 11:16
by 7iben
great thank you. That's exactly what I mean