order of list for recently closed tabs
Moderators: Hacker, petermad, Stefan2, white
order of list for recently closed tabs
Hello guys,
I am looking for a way to restore the last closed tab through a shortcut key.
The main challenge is that TC orders these in a way (top down, but from the middle) which makes it difficult to impossible to script.
It would be much more easier if the last closed panel was placed at the very bottom of the Recently closed tab list.
Perhaps there is a solution through TCFS?
Thank you very much for the great work
I am looking for a way to restore the last closed tab through a shortcut key.
The main challenge is that TC orders these in a way (top down, but from the middle) which makes it difficult to impossible to script.
It would be much more easier if the last closed panel was placed at the very bottom of the Recently closed tab list.
Perhaps there is a solution through TCFS?
Thank you very much for the great work
Re: order of list for recently closed tabs
You can bind em_SaveCurTabs&CloseActiveTab (em_SaveTabs,cm_CloseCurrentTab) to Ctrl+W, where em_SaveTabs = SAVETABS2L "%COMMANDER_PATH%\Tabs\Last.tab",
and then use the recovery command em_RestoreTabs = OPENTABSL "%COMMANDER_PATH%\Tabs\Last.tab" (Ctrl+Shift+T or Ctrl+Alt+Z, for example).
and then use the recovery command em_RestoreTabs = OPENTABSL "%COMMANDER_PATH%\Tabs\Last.tab" (Ctrl+Shift+T or Ctrl+Alt+Z, for example).
Overquoting is evil! 👎
Re: order of list for recently closed tabs
2Fla$her
Thank you for this suggestion. Indeed it is an interesting solution, which destroys all tabs and recreate them from a file. But there is an inconvenient side effect of it. These actions would refresh all of the tabs, which includes some remote folder locations.
I was hoping to be able to do something like:
send keys CS+A (? what is the internal command here)
send keys UP
send keys Enter
For this to work though, TC would have to sort the list of the closed tabs from the bottom to the top and not as it is now (from the "middle" to the bottom )
Hence it is a suggestion for a feature
Thank you for this suggestion. Indeed it is an interesting solution, which destroys all tabs and recreate them from a file. But there is an inconvenient side effect of it. These actions would refresh all of the tabs, which includes some remote folder locations.
I was hoping to be able to do something like:
send keys CS+A (? what is the internal command here)
send keys UP
send keys Enter
For this to work though, TC would have to sort the list of the closed tabs from the bottom to the top and not as it is now (from the "middle" to the bottom )
Hence it is a suggestion for a feature
Re: order of list for recently closed tabs
igarny wrote: 2024-03-01, 05:28 UTC I was hoping to be able to do something like:
send keys CS+A (? what is the internal command here)
send keys UP
send keys Enter
TCFS2.exe /ef tcm(5515,1) send({Up}) send({Enter}) |
But unlike the previous solution, there is a dependence on the focus of the desired panel.
Why from the middle? I don't observe this.
Overquoting is evil! 👎
Re: order of list for recently closed tabs
2igarny
Immediately after closing a tab you can reopen it with the combined command: cm_OpenNewTab,cm_GotoPreviousDir
But it will ONLY work if you have NOT done any navigating after you closed the tab - so it is an instant "oops"-command.
Immediately after closing a tab you can reopen it with the combined command: cm_OpenNewTab,cm_GotoPreviousDir
But it will ONLY work if you have NOT done any navigating after you closed the tab - so it is an instant "oops"-command.
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Re: order of list for recently closed tabs
If the tab is locked with the ability of folder changing, then this will not work if the linked folder was changed.But it will ONLY work if you have NOT done any navigating after you closed the tab - so it is an instant "oops"-command.
Overquoting is evil! 👎
Re: order of list for recently closed tabs
Neither will using the "Recently closed tabs" entry in the Folder Tab list (Ctrl+Shift+A) - it will also open the last opened folder in the tab, not the locked folder.If the tab is locked with the ability of folder changing, then this will not work if the linked folder was changed.
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Re: order of list for recently closed tabs
I think it's an omission of the author that he doesn't save the full tab state until it's closed.not the locked folder.
2igarny
AHK doesn't allow to control THistoryForm/TOwnerdrawPanel via ControlFocus/WinMenuSelectItem, so I don't see a scripting solution yet.
But there is one effective idea:
- In <wcmd_xyz.lng> on line 2063="..." insert & before any space.
- Update the language (this can be done from the command line): OPENLANGUAGEFILE <wcmd_xyz.lng>
- Use the hotkey (without Alt/Ctrl) with em_command: TCFS2.exe /ef tcm(3009,1) send(` {ENTER}`)
Overquoting is evil! 👎
Re: order of list for recently closed tabs
2Fla$her
Unfortunately for me I have no line having "2063" in the "wcmd_ext_eng.lng" file.
It is the only *.lng file I have there.
Please share your line?
My *lng* file is custom from a previous Russian compilation, so it might be the case, that is not being updated after TC upgrades.
P.S.
in response to this: viewtopic.php?p=451345#p451345
and for the record only (as I can see Fla$her supported the request later)
My statement about the list is "from the middle", because if one closes 2 or more tabs, then these are sorted in the Tabs list in the order top-down under the item "Recently closed tabs", which makes it difficult to automate for recovery
Meaning after closing several tabs, the last closed tab is not the one at the bottom of the list, but higher.
Unfortunately for me I have no line having "2063" in the "wcmd_ext_eng.lng" file.
It is the only *.lng file I have there.
Please share your line?
My *lng* file is custom from a previous Russian compilation, so it might be the case, that is not being updated after TC upgrades.
P.S.
in response to this: viewtopic.php?p=451345#p451345
and for the record only (as I can see Fla$her supported the request later)
My statement about the list is "from the middle", because if one closes 2 or more tabs, then these are sorted in the Tabs list in the order top-down under the item "Recently closed tabs", which makes it difficult to automate for recovery
Meaning after closing several tabs, the last closed tab is not the one at the bottom of the list, but higher.
Re: order of list for recently closed tabs
2igarny
You need to replace the old LNG file with last tcmd№x<32/64/32_64>.exe\INSTALL.CAB\LANGUAGE\WCMD_???.LNG.
Apparently, when updating the version, you neglect this important update.
Shifting the focus to submenu immediately shifts the focus to the first item with the last closed tab.
You need to replace the old LNG file with last tcmd№x<32/64/32_64>.exe\INSTALL.CAB\LANGUAGE\WCMD_???.LNG.
Apparently, when updating the version, you neglect this important update.
This is understandable, so I ended up choosing the submenu in cm_DirTabsShowMenu instead of the item in cm_SrcTabsList.igarny wrote: 2024-03-03, 21:22 UTC Meaning after closing several tabs, the last closed tab is not the one at the bottom of the list, but higher.
Shifting the focus to submenu immediately shifts the focus to the first item with the last closed tab.
Overquoting is evil! 👎
Re: order of list for recently closed tabs
2Fla$her
Thank you for your expert guidance. Indeed I am missing this item in the LNG file, BUT
Unfortunately from this file (https://totalcommander.ch/1103/tcmd1103x64.exe) I am not able to find the respective English version of the LNG file. I found only a MNU file
I found many other languages and thus can confirm the discrepancy between my config and expected one
I'll dig in further.
Thank you for your expert guidance. Indeed I am missing this item in the LNG file, BUT
Unfortunately from this file (https://totalcommander.ch/1103/tcmd1103x64.exe) I am not able to find the respective English version of the LNG file. I found only a MNU file
I found many other languages and thus can confirm the discrepancy between my config and expected one
I'll dig in further.
Re: order of list for recently closed tabs
2igarny
There is no English LNG in the installer, because this language is built into the program, but you can take wcmd_*_eng.lng from any archive from here.
Only in it, the front ampersand will have to be moved to a space. There can only be one ampersand.
Although in the case of English, the entire contents of the file may be like this:which will result in this single change.
There is no English LNG in the installer, because this language is built into the program, but you can take wcmd_*_eng.lng from any archive from here.
Only in it, the front ampersand will have to be moved to a space. There can only be one ampersand.
Although in the case of English, the entire contents of the file may be like this:
Code: Select all
English
2063="Recently& closed tabs"
Last edited by Fla$her on 2024-03-04, 13:27 UTC, edited 1 time in total.
Overquoting is evil! 👎
Re: order of list for recently closed tabs
2igarny
2063="Recently& closed tabs"
Until you find the file you want, add the line to the old file:Unfortunately for me I have no line having "2063" in the "wcmd_ext_eng.lng" file.
2063="Recently& closed tabs"
Re: order of list for recently closed tabs
The English language files are also available here: https://plugins.ghisler.com/languages/wcmd_eng.zip
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Re: order of list for recently closed tabs
2igarny
I did some thinking with AHK. Here's what came out:
LNG doesn't need to be edited. But the file, of course, must be up-to-date.
There are no problems with modifiers (except Ctrl+Shift+) either. I chose Ctrl+Alt+Z (as in Gecko browsers), conveniently.
I did some thinking with AHK. Here's what came out:
RestoreLastClosedTab.ahk
Code: Select all
#NoTrayIcon
#KeyHistory, 0
ListLines, Off
SetBatchLines,-1
IniRead, LNG, %COMMANDER_INI%, Configuration, LanguageIni
If LNG = ERROR
Item = Recently closed tabs
Else {
If InStr(LNG, "\") = 0
LNG = %COMMANDER_PATH%\Language\%LNG%
FileReadLine, CP, %LNG%, 2
If InStr(CP, "codepage=",0, 1) = 1
FileEncoding, % "CP" . SubStr(CP, 10)
FileReadLine, Item, %LNG%, 965
If StrSplit(Item, "=")[1] = 2063
Item = % StrSplit(Item, """")[2]
Else {
FileRead, Item, %LNG%
RegExMatch(Item, "\n2063=""\K[^""]+", Item)
}
}
PostMessage, 1075, 3009, 0,, A
WinWait, ahk_class #32768
WinGet, hwnd, ID, ahk_class #32768
SendMessage, 0x1E1,,,, ahk_id %hwnd%
Count := DllCall("GetMenuItemCount", Ptr, hMenu := ErrorLevel) - 14
Loop, % Count
{ Idx := A_Index + 14
iNums++ := DllCall("GetMenuString", Ptr, hMenu, UInt, Idx, Ptr, 0, Int, 0, UInt, 0x400)
VarSetCapacity(vItem, iNums << !!A_IsUnicode)
DllCall("GetMenuString", Uint, hMenu, int, Idx, Str, vItem, Int, iNums, Uint, 0x400)
If (vItem = Item)
{ SendMessage, 0x1E5, Idx,,, ahk_id %hwnd%
Loop, 2
ControlSend, , {Enter}, ahk_id %hwnd%
break
}
}
If (Idx = Count + 14)
WinClose, ahk_id %hwnd%
There are no problems with modifiers (except Ctrl+Shift+) either. I chose Ctrl+Alt+Z (as in Gecko browsers), conveniently.
Overquoting is evil! 👎