How to close invalid tabs automatically?

English support forum

Moderators: Hacker, Stefan2, white, sheep

Post Reply
Orochi
Junior Member
Junior Member
Posts: 46
Joined: 2011-10-09, 21:32 UTC

How to close invalid tabs automatically?

Post by *Orochi » 2018-09-02, 22:58 UTC

Hello everyone,

I was wondering if there is a way to automatically close tabs that have invalid paths?
I work with virtual images, once the images are unmounted, TC ends up with many open tabs that have invalid paths.
So I have to manually close them which kind of counterproductive.

Thanks.

User avatar
HerbieH
Junior Member
Junior Member
Posts: 89
Joined: 2003-02-11, 10:04 UTC

Re: How to close invalid tabs automatically?

Post by *HerbieH » 2018-09-03, 21:55 UTC

Everybody is annoyed with the waiting time, until an error occurs, when clicking on a tab with a missing target.. an USB or virtual-drive, network-drive, FTP-link, or whatever. BUT a measuring system, that closes all invalid tabs when (finally) detected not-valid, would be more annoying.

You could be sitting, working with TC, and suddenly 'puff' one or more tabs disappears - at random. - And what about, if the targets of the closed tabs came back online? Should they reopen?

A better idea might actually be a detection system, that measures the validity of each tab, say, every 30 second, which changes the color to red for invalid tabs, and back to a normal color, when / or if / a tab becomes valid - AND of course with switches to set the time, and also turn the detection on and off.

I am not a programmer, but I think this would be possible. :)
HerbieH*
-Keep on makin' music!

Orochi
Junior Member
Junior Member
Posts: 46
Joined: 2011-10-09, 21:32 UTC

Re: How to close invalid tabs automatically?

Post by *Orochi » 2018-09-03, 23:17 UTC

Based on your elaborate reply, it seems that what I am asking is not currently possible.
HerbieH wrote:
2018-09-03, 21:55 UTC
BUT a measuring system, that closes all invalid tabs when (finally) detected not-valid, would be more annoying.
I disagree. If done right, it would not annoy anyone.
There are many keys in wincmd.ini that give users sometimes 2 or 3 even 4 options for a certain behavior of TC.
For me personally, If implemented through a new value in wincmd.ini as an option, it would satisfy everyone.
I mean the easiest things to do, would be to make a new shortcut to close all invalid tabs, just like there is one now for closing all tabs or closing duplicate tabs.
You could be sitting, working with TC, and suddenly 'puff' one or more tabs disappears - at random.
And what is the problem with that? You unmounted virtual drives, tabs should close after paths become invalid. If you want to recycle the tabs in case of network drives, lock them.

User avatar
Dalai
Power Member
Power Member
Posts: 6198
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: How to close invalid tabs automatically?

Post by *Dalai » 2018-09-04, 00:29 UTC

Orochi wrote:
2018-09-03, 23:17 UTC
You could be sitting, working with TC, and suddenly 'puff' one or more tabs disappears - at random.
And what is the problem with that? You unmounted virtual drives, tabs should close after paths become invalid.
There are many - and I mean MANY - reasons why a path can become invalid, not all of which mean that they're actually invalid. Sometimes it can mean that the target becomes valid again after a short period of time, sometimes it's even on purpose!

I suggest to implement a new cm_ command that takes care of invalid tabs on user request. This may even be added to the tab context menu so it's readily available. IMO this is the only good way to do it, automatic closing of tabs is just prone to user troubles and bug reports, timer-controlled is better but still not good enough. That's all IMO, but one thing I know for sure: an application should never ever automatically close anything on its own!

Regards
Dalai
#101164 Personal licence
Athlon X4 880K, 16 GiB RAM, Gigabyte F2A88X-D3HP, Win7 x64

Plugins: Services2, Startups

Orochi
Junior Member
Junior Member
Posts: 46
Joined: 2011-10-09, 21:32 UTC

Re: How to close invalid tabs automatically?

Post by *Orochi » 2018-09-04, 04:26 UTC

Dalai wrote:
2018-09-04, 00:29 UTC
There are many - and I mean MANY - reasons why a path can become invalid, not all of which mean that they're actually invalid. Sometimes it can mean that the target becomes valid again after a short period of time, sometimes it's even on purpose!
Real examples would be nice. Also to satisfy everyone, I propose a new key for wincmd.ini

Also what do you do when you click on a tab that has an invalid path, I mean the tabs you keep for in case they will become valid again?

User avatar
j7n
Member
Member
Posts: 133
Joined: 2005-08-07, 21:56 UTC

Re: How to close invalid tabs automatically?

Post by *j7n » 2018-09-04, 04:59 UTC

An example. If I eject a CD or unmount a disc image in Daemon Tools, the drive becomes invalid and the tab contents jump to C: or the window is closed entirely (in Windows Explorer). What I usually want to do is insert another disc and look at its contents in the same window. Maybe I want to copy a series of discs. A locked tab remains locked pointing to the CD drive, but then a new tab is created pointing the root of some drive (usually C:), for which I have no use.

I seem to recall this un-helpful behavior of closing Explorer windows started win Windows XP.
#148174 Personal license
Running Total Commander v8.52a

Orochi
Junior Member
Junior Member
Posts: 46
Joined: 2011-10-09, 21:32 UTC

Re: How to close invalid tabs automatically?

Post by *Orochi » 2018-09-04, 05:25 UTC

j7n wrote:
2018-09-04, 04:59 UTC
the drive becomes invalid and the tab contents jump to C
I believe this behavior is only true for a recycled tab not newly created tabs. Also, the last invalid active tab will be redirected to C:, not all invalid tabs. Mount 3 images at the same time and open 3 tabs, pointing to the path, then unmount all images.
A locked tab remains locked pointing to the CD drive
How so? If you click on that tab with invalid path locked or not, TC will produce an error window asking you to chose another disk.

User avatar
Dalai
Power Member
Power Member
Posts: 6198
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: How to close invalid tabs automatically?

Post by *Dalai » 2018-09-04, 14:50 UTC

Orochi wrote:
2018-09-04, 04:26 UTC
Real examples would be nice.
Had thought about adding some examples initially. Here we go:
  • Removal of a virtual drive, like in your use case
  • Removal of a physical drive, e.g. external USB flash drive, HDD or something like that
  • Loss of network connection, so a mapped network drive or even UNC path becomes (temporarily) invalid
  • Removal of a substituted path, e.g.:

    Code: Select all

    subst Z: /d
  • Changing NTFS permissions so a directory refresh could fail because access may be denied after that. This is also a case where the path may become valid again (after reverting the permission change).
  • Changing/Removing a mount point or drive letter in Windows Disk Management (or mountvol or diskpart)
  • Unloading a file-system plugin, maybe even removing the plugin while TC is running, only in the latter case it would make sense to close such a tab - but maybe not, because it could be on purpose to update a plugin. However, the TC file-system plugins provide a wide variety of potentially invalid path situations!
  • Loss of VPN or SSH tunnel connection so that specific (network) resources are not available
And I'm pretty sure that there are plenty more use cases for other users.
Also what do you do when you click on a tab that has an invalid path, I mean the tabs you keep for in case they will become valid again?
Usually when I know that a path is going to become invalid I let it do so, in which case TC switches to the system drive automatically. The difference is that the tab is reusable, maybe for the next virtual drive I'll mount after a short period of time.

Regards
Dalai
#101164 Personal licence
Athlon X4 880K, 16 GiB RAM, Gigabyte F2A88X-D3HP, Win7 x64

Plugins: Services2, Startups

Orochi
Junior Member
Junior Member
Posts: 46
Joined: 2011-10-09, 21:32 UTC

Re: How to close invalid tabs automatically?

Post by *Orochi » 2018-09-04, 19:15 UTC

Dalai
Your reasoning is clear. Just keep in mind that I am not proposing closing of all invalid tabs automatically as a default behavior, I am simply suggesting a key that gives you option to do so.
Usually when I know that a path is going to become invalid I let it do so, in which case TC switches to the system drive automatically. The difference is that the tab is reusable, maybe for the next virtual drive I'll mount after a short period of time.
If the tab is active while the path becomes invalid then it will be redirected to system drive. If you open bunch of tabs and the path becomes invalid in all of them, only the active tab will be redirected to system drive.

User avatar
Dalai
Power Member
Power Member
Posts: 6198
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: How to close invalid tabs automatically?

Post by *Dalai » 2018-09-04, 21:03 UTC

Orochi wrote:
2018-09-04, 19:15 UTC
Just keep in mind that I am not proposing closing of all invalid tabs automatically as a default behavior, I am simply suggesting a key that gives you option to do so.
Yes, I understand that. But I suggest to implement it in a way that works on user request instead, like in the tab context menu, e.g. an item "Close all tabs with invalid paths now", and/or as cm_ command, e.g. cm_CloseInvalidTabs or something along those lines. Such an approach is much less prone to users complaining about "vanishing tabs" or similar "bug reports". This might even occur when users set that option in wincmd.ini and forget about it, like is the case with other wincmd.ini options like CopyLinks and such. Sometimes another wincmd.ini option is just the wrong place, and IMO it is in this case.
If you open bunch of tabs and the path becomes invalid in all of them, only the active tab will be redirected to system drive.
True, but I reuse them or close them depending on the situation, depending on what I want to do next. Another reason why I think automatic closing is not a good suggestion which would be able to cover all possible use cases.

Regards
Dalai
#101164 Personal licence
Athlon X4 880K, 16 GiB RAM, Gigabyte F2A88X-D3HP, Win7 x64

Plugins: Services2, Startups

User avatar
HerbieH
Junior Member
Junior Member
Posts: 89
Joined: 2003-02-11, 10:04 UTC

Re: How to close invalid tabs automatically?

Post by *HerbieH » 2018-09-16, 11:40 UTC

Hello again. 8)

I've been reading all the answers in this thread thoroughly.

And I (still) totally agree, that removing anything(!) automatically: tabs in TC, funds from your bank account, bodily abilities due to old age (sh**! that actually happens) :( - It is a very BAD idea. ...very!

BUT.. I still think the solution i mentioned above, about a detection system, that measures the validity of each tab (read the second post) is a good idea. It doesn't delete any tabs and could generally be very useful and informative.

Everybody have a nice sunday. :P
HerbieH*
-Keep on makin' music!

User avatar
Vochomurka
Power Member
Power Member
Posts: 772
Joined: 2005-09-14, 22:19 UTC
Location: Russia
Contact:

Re: How to close invalid tabs automatically?

Post by *Vochomurka » 2018-09-16, 13:27 UTC

In my TabTools script closing invalid tabs (explicitly or implicitly) is one of auxiliary functions

Post Reply