Page 1 of 1

[TC 11.00rc3 and older] focus commands does not work after cm_Copy or cm_RenMov

Posted: 2023-07-30, 22:50 UTC
by petermad
When combining commands with cm_Copy or cm_RenMov combinations like these works fine:

Code: Select all

cm_Copy,cm_SrcByExt
cm_Copy,cm_SrcShort
cm_Copy,cm_SrcUserSpec
But if I combine with the focus commands like these, the focus commands are ignored:

Code: Select all

cm_Copy,cm_FocusTrg
cm_Copy,cm_FocusCmdLine
cm_Copy,cm_FocusMainMenu
This is not new to TC 11.00 - it also applies to at least TC 11.52

I can to a degree work around it by using:

Code: Select all

cm_Copy,cm_Wait 300,cm_FocusTrg
But it does not work, if the Overwrite dialog has been opened, and the value 300 might not work on all computers, depending on processor speed.

Re: [TC 11.00rc3 and older] focus commands does not work after cm_Copy or cm_RenMov

Posted: 2023-07-31, 08:01 UTC
by ghisler(Author)
Unfortunately this cannot be fixed: the cm_copy command ends when the operation is sent to a background thread - this happens as soon as you can press the "Background" button in the copy progress dialog. Some commands can be executed while a progress dialog is up, like cm_SrcByExt. Some can't like cm_FocusTrg, because the modal progress dialog prevents the focus change from happening. What you can do is start the operation directly in background via cm_copy command line parameters.

Re: [TC 11.00rc3 and older] focus commands does not work after cm_Copy or cm_RenMov

Posted: 2023-07-31, 08:37 UTC
by petermad
What you can do is start the operation directly in background via cm_copy command line parameters.
I tried with:

Code: Select all

cm_Copy /G,cm_FocusTrg
But that didn't help - can you expalin further what you mean by: "via cm_copy command line parameters" ?

Re: [TC 11.00rc3 and older] focus commands does not work after cm_Copy or cm_RenMov

Posted: 2023-07-31, 09:10 UTC
by ghisler(Author)
I meant something like
cm_Copy /B1,cm_wait 100,cm_FocusTrg
or
cm_Copy /B1G,cm_wait 100,cm_FocusTrg

A tiny delay is still needed to give Total Commander a chance to get the focus back, but it will always work even of the operation takes longer.

Re: [TC 11.00rc3 and older] focus commands does not work after cm_Copy or cm_RenMov

Posted: 2023-07-31, 10:29 UTC
by petermad
2ghisler(Author)
OK - that works. I generally don't use the background copy though.

But - if I want to do:

Code: Select all

cm_Copy /B1,cm_Wait 100,cm_FocusTrg,cm_SelectAllBoth
It does not work, unless the files and folders I want to copy (and overwrite) are already in the target.

Re: [TC 11.00rc3 and older] focus commands does not work after cm_Copy or cm_RenMov

Posted: 2023-07-31, 11:32 UTC
by sa16
2petermad
It does not work
This is logical: the files have not yet been copied.

Re: [TC 11.00rc3 and older] focus commands does not work after cm_Copy or cm_RenMov

Posted: 2023-07-31, 11:53 UTC
by petermad
the files have not yet been copied.
Exactly - if I set cm_Wait to 5000, it works for copying a few files - so we are again caught by a timing problem.

Re: [TC 11.00rc3 and older] focus commands does not work after cm_Copy or cm_RenMov

Posted: 2023-07-31, 13:33 UTC
by ghisler(Author)
The problem is that the user can move the operation to the background, back to the foreground, pause it, start other operations while the operation is in the background, etc. etc. Therefore it's not realistically possible to wait until all operations are done.

Re: [TC 11.00rc3 and older] focus commands does not work after cm_Copy or cm_RenMov

Posted: 2023-08-01, 11:42 UTC
by petermad
OK.

So for this to be realistic we would need another command or a parameter for restricting the copy process from being moved between foreground and background.

This can be moved to TC Suggestions...

Re: [TC 11.00rc3 and older] focus commands does not work after cm_Copy or cm_RenMov

Posted: 2023-08-01, 12:54 UTC
by ghisler(Author)

Moderator message

Moved to suggestions