close last Tab

Features wanted...
Post Reply
7iben
Posts: 130
Joined: 04 Apr 2019 18:22

close last Tab

Post 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?
(OS: Windows 11 Pro on Parallels ARM Virtual Machine - XY: Current x64 beta - Display: 3440x1440 @ 125%)

RalphM
Posts: 2089
Joined: 27 Jan 2005 23:38
Location: Cairns, Australia

Re: close last Tab

Post 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).
Ralph :)
(OS: W11 25H2 Home x64 - XY: Current x64 beta - Office 2024 64-bit - Display: 1920x1080 @ 125%)

highend
Posts: 14953
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: close last Tab

Post 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?
One of my scripts helped you out? Please donate via Paypal

7iben
Posts: 130
Joined: 04 Apr 2019 18:22

Re: close last Tab

Post 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?
(OS: Windows 11 Pro on Parallels ARM Virtual Machine - XY: Current x64 beta - Display: 3440x1440 @ 125%)

highend
Posts: 14953
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: close last Tab

Post 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; }
        }
    }
One of my scripts helped you out? Please donate via Paypal

7iben
Posts: 130
Joined: 04 Apr 2019 18:22

Re: close last Tab

Post by 7iben »

great thank you. That's exactly what I mean
(OS: Windows 11 Pro on Parallels ARM Virtual Machine - XY: Current x64 beta - Display: 3440x1440 @ 125%)

Post Reply