How to clear/reset a filter when navigating out of folder?

Hey guys,

I am using this button below to filter files in the current folder, which contain certain characters in their name.

set SHOWFILTERFILENAME=(*-G(1|2|3|4|5|6|7|8|9|0)*)

I am finding that the filter remains applied when going back/up out of the folder. I would like to have the filter only apply to the current folder and to be lifted when I navigate back/up out of the folder OR when I navigate to another folder within the filtered folder (sort of like the quick search bar in the top right of the DOpus lister).

Is this at all possible?

Thanks a lot for any help.

I am thinking possibly you could do this by using a path format? settings>folder formats>new path format, then in the filter tab set your filter. i'm not sure but it's worth a shot, and probably a few ways this could be accomplished

Hi der_affe,

Thanks for the reply.

Unfortunately the path format feature does not suit my requirements. I intend to be frequently switching between filters for different characters/strings (ie. sometimes I will need to filter for filenames containing G, other time I will be filtering for A or B, etc).

Setting a default filter for this specific path is a little too rigid.

Thanks for the reply though, any other suggestions?

maybe some type of drop-down box allowing you to select the filter from the ones you've set? you could ask aussieboykie, he wrote a script for me to act similarly based on a filter i'd set up

The filter bar has an option to clear the filter when changing folders, so using that will let you get what you want.

For detailed help, please link your account.

The SHOWFILTERFILENAME seems to be a different filter to the filter bar. I could not clear the above filter from the filter bar.

Calling Set CLEARFILTERS worked. You could create a script that captures the OnAfterFolderChange event and runs Set CLEARFILTERS.

Indeed. It sets the filter in the folder format, which isn't the same as the filter bar's one. There's another command for setting that.

Hi guys,

Sorry for taking so long to get back. I have been a bit preoccupied this last few weeks.

I am finding that the command/button works exactly as I require it to for network directories only, for all local directories it seems to 'remember' the filters when navigating to other folders.

How would you guys suggest I overcome this?

Looking forward to hearing back.

I miss understood Leo's suggestion. He was saying don't use SHOWFILTERFILENAME. Instead use the filter bar, you can do this via the set QUICKFILTER
Try this

set QUICKFILTER (*-G(1|2|3|4|5|6|7|8|9|0)*)

To test, in the Lister press >, then you can paste that line of code

Also make sure this is on:

Preferences / File Displays / Filter Bar / Clear Quick filter automatically when changing folders.

Great. Thanks a lot for that wowbagger and leo. Seems to work fine so far.

Thanks for the help.