TC 10.52 strange behavior when editing txt file in archive and VS Code

English support forum

Moderators: Stefan2, white, Hacker

Post Reply
Aurelien
Junior Member
Junior Member
Posts: 37
Joined: 2003-10-06, 08:28 UTC

TC 10.52 strange behavior when editing txt file in archive and VS Code

Post by *Aurelien »

Hi,

When i open a text file in a zip or 7z archive (F4 -> Visual Studio Code), the temporary file is actually created in c:\Users\a.dellieux\AppData\Local\Temp\_tc\file.txt, and opened in Visual Studio Code.

Without touching anything, after a second, in VSCode tabs, the file name font changes from normal file font to red + striked

If i go to the temp dir mentioned above, the file has been deleted.

I tried with Notepad++ and Sublime Text, and nothing similar happens.
The behavior is the normal one with those text editors : file is edited, and when closing the application, TC notice changes and ask for storing it in the archive.

Maybe of importance : VS Code is installed in user profile directory : c:\Users\yyyyyyyyy\AppData\Local\Programs\Microsoft VS Code\Code.exe
I'm using latest VS Code (1.73.1)
User avatar
Stefan2
Power Member
Power Member
Posts: 3771
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: TC 10.52 strange behavior when editing txt file in archive and VS Code

Post by *Stefan2 »

Aurelien wrote: 2022-11-25, 09:12 UTC When i open a text file in a zip or 7z archive (F4 -> Visual Studio Code), the temporary file is actually created ....
...
If i go to the temp dir mentioned above, the file has been deleted.

I tried with Notepad++ and Sublime Text, and nothing similar happens.
....

So it seems the case is on VSC, maybe it remove the handle from that
temporary file too soon, and so TC thinks you are done and TC can clean up.


I don't know if there's a work around.


Maybe read the help > ini settings > and try out that:
EditWaitTime=2 Timeout value when editing files from an archive or ftp server:
If an editor closes within this amount of seconds,
assume that it's a multiple document editor and show dialog where user can confirm when editing has ended.
Set to 0 to turn off this feature.
Set to -1 to not show this dialog at all (e.g. when the file was passed via DDE to the associated program).




 
Aurelien
Junior Member
Junior Member
Posts: 37
Joined: 2003-10-06, 08:28 UTC

Re: TC 10.52 strange behavior when editing txt file in archive and VS Code

Post by *Aurelien »

@Stefan2,

tried EditValue with a value of -1 and it worked, after restarting TC

i removed this entry and restarted TC
meantime, i had quit VSC
then i hit F4 to edit the file in the archive, but the file is correctly edited.

i begin to think it could be caused by VSC Restricted Mode.

when VSC is already launched using a Trusted folder, hitting F4 to edit an extracted file into temp generates the file deletion.

when VSC is not launched, and i hit F4 to edit the file, then VSC is launched without the Trusted folder, then the file edition is correct this time.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 44410
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: TC 10.52 strange behavior when editing txt file in archive and VS Code

Post by *ghisler(Author) »

That's because when you try to launch a program and it's already running, it may pass the name to the already running copy and close itself. If TC sees that an app closes within 2 seconds, it assumes this scenario and doesn't delete the file. Visual Studio Code is a very big program and probably takes more than 2 seconds to launch, so TC only sees it closing and deletes the file.
So set EditWaitTime to a larger value like 5 or to -1.
Author of Total Commander
https://www.ghisler.com
Aurelien
Junior Member
Junior Member
Posts: 37
Joined: 2003-10-06, 08:28 UTC

Re: TC 10.52 strange behavior when editing txt file in archive and VS Code

Post by *Aurelien »

I'm able to confirm that setting EditWaitTime to 5 perfectly works.
The little dialog box (Close / Send To Background) now appears after some time, and VSCode does not change tab caption to striked red.
Many thanks, @Christian
Please feel free to close this report, definitely not a bug, and caused by VSCode implementation (maybe because of several processes, Chromium based editor)
User avatar
Hacker
Moderator
Moderator
Posts: 12643
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Re: TC 10.52 strange behavior when editing txt file in archive and VS Code

Post by *Hacker »

Moderator message from: Hacker

Moved to the English forum.
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
Post Reply