Suggestion: add a "cm_" command to (re)read & (re)apply the [Colors] & [searches] sections (without restart TC)

Here you can propose new features, make suggestions etc.

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
Mjolnir
Member
Member
Posts: 133
Joined: 2005-10-08, 21:03 UTC

Suggestion: add a "cm_" command to (re)read & (re)apply the [Colors] & [searches] sections (without restart TC)

Post by *Mjolnir »

Hello,

Is it possible to have an internal "cm_" command that performs :
- read the [Colors] & [searches] sections
- & then, reapply the "filters" (like "cm_SwitchColorsByFileType")

I'm used to assign file extension directly within the TC .ini [searches] keys, but always needs to stop & restart TC to apply it...

Thx.
Longue vie a TC... déjà + de 20 ans de bons et loyaux services chez moi !
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6482
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: Suggestion: add a "cm_" command to (re)read & (re)apply the [Colors] & [searches] sections (without restart TC)

Post by *Horst.Epp »

Redirect the Searches section and point it to an link.
Then you can swap the link without restarting TC.
Windows 11 Home x64 Version 23H2 (OS Build 22631.3447)
TC 11.03 x64 / x86
Everything 1.5.0.1372a (x64), Everything Toolbar 1.3.3, Listary Pro 6.3.0.73
QAP 11.6.3.2 x64
User avatar
Mjolnir
Member
Member
Posts: 133
Joined: 2005-10-08, 21:03 UTC

Re: Suggestion: add a "cm_" command to (re)read & (re)apply the [Colors] & [searches] sections (without restart TC)

Post by *Mjolnir »

:( Sorry, I did not understand your reply/way to perform it...
Longue vie a TC... déjà + de 20 ans de bons et loyaux services chez moi !
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6482
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: Suggestion: add a "cm_" command to (re)read & (re)apply the [Colors] & [searches] sections (without restart TC)

Post by *Horst.Epp »

Example:
Replace in your Wincmd.ini the [Searches} section with all its entries with

[searches]
RedirectSection=Searches.ini

Store the replaced section in a file named Searches1.ini
Make a link named Searches.ini to the file Searches1.ini
Now you can just swap the link and let in point to another file, Searches2.ini for example.
Windows 11 Home x64 Version 23H2 (OS Build 22631.3447)
TC 11.03 x64 / x86
Everything 1.5.0.1372a (x64), Everything Toolbar 1.3.3, Listary Pro 6.3.0.73
QAP 11.6.3.2 x64
User avatar
Mjolnir
Member
Member
Posts: 133
Joined: 2005-10-08, 21:03 UTC

Re: Suggestion: add a "cm_" command to (re)read & (re)apply the [Colors] & [searches] sections (without restart TC)

Post by *Mjolnir »

Thank you, clever idea, works as you explained
... but unfortunately, not as I "guessed" => I used this to assign colors to patterns, shown in TC's panels...

OK on Config "searches"

1. WINCMD.INI

Code: Select all

[searches]
RedirectSection=Searches.ini
2. Create SearchesClr.ini

Code: Select all

[searches]
ColorRed_SearchFor=*-KO*;*.no;*.ko
ColorRed_SearchIn=
ColorRed_SearchText=
ColorRed_SearchFlags=0|002002000020|||||||||0000|||
ColorGreen_SearchFor=*-OK*;*.yes;*.ok
ColorGreen_SearchIn=
[etc...]
3. mklink /H Searches.ini SearchesClr.ini
=> OK, works fine... in the Alt+F7 & "Load/Search"
4. Create a new SearchesClrInverted.ini file
5. mklink /H Searches.ini SearchesClrInverted.ini
=> OK, works fine (on new patterns)... in the Alt+F7 & "Load/Search"

---

(but) KO on "assigned colors" to "search file patterns" on files/folders within TC's panels

(The joke is, "there's always a but") => I'm used to quickly assign color to (new) search pattern using a script to directly write into TC .ini (*)... and unless I restart TC, colors are not re-applied within TC's panels :( ( Like : https://ibb.co/BKLtwdw )

That's why I initially suggested for a specific "cm_" command to re-read both [searches] and [Colors] sections to re-apply pattern filters/colors in live...


---
(*) I got a quite advanced script that, for files/folders selected, update my TC .ini file with files/folders patterns and matching (or requested to user) colors (in [Colors] & [searches] sections)... and then, restart TC (<- it's this last step that I'd like to avoid, and replace it by an internal "re-read in live" command)
Longue vie a TC... déjà + de 20 ans de bons et loyaux services chez moi !
User avatar
petermad
Power Member
Power Member
Posts: 14796
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Suggestion: add a "cm_" command to (re)read & (re)apply the [Colors] & [searches] sections (without restart TC)

Post by *petermad »

2Mjolnir
Help wrote:CM_REREADSOURCE 1: forces refresh even if nothing has changed in that directory, e.g. to re-load icons and overlays
2: re-applies automatic view mode change to current directory
3: both
Have you tried if CM_REREADSOURCE 1, 2 or 3 helps.

Otherwise try cm_Exit 5
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
Mjolnir
Member
Member
Posts: 133
Joined: 2005-10-08, 21:03 UTC

Re: Suggestion: add a "cm_" command to (re)read & (re)apply the [Colors] & [searches] sections (without restart TC)

Post by *Mjolnir »

Hum , unfortunately, yes, already tried command "CM_REREADSOURCE" (with none, and even with different parameters,1 or 2 or 3), but does not reread the TC .ini sections (or, at least, read it , but not apply changes in live in TC's panels :( )

"cm_Exit 5" -> works, but restart TC (it's the "restart order" command I use)...
Longue vie a TC... déjà + de 20 ans de bons et loyaux services chez moi !
Post Reply