-
Notifications
You must be signed in to change notification settings - Fork 511
exiftool.exe hangs on Run Selection (F8) #2559
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
It would be really helpful if you could also attach the logs--instructions for how to do that are here |
Log files attached: VSCode settings: |
+1 Not sure why this is still marked needs repro, but here's another example. $focalLength = &"$env:USERPROFILE\Tools\Images\exiftool.exe" -FocalLength -b "$path$fileName.MP4" This line works fine when copy/pasted into Visual Studio Code's PowerShell terminal, when run in PowerShell 7 directly, and when run in PowerShell ISE. Calls to other tools, such as $resolution = &"C:\Windows\System32\nslookup.exe" "microsoft.com" are more successful.
|
I just managed to look into this, and got a repro on my machine specifically with I suspected this might be an issue with the integrated terminal interacting with Given the specificity of this bug to a particular executable, it's unlikely we'll have time to look into this ourselves. Since this works in the integrated console today, one workaround is to use VSCode's own "run in terminal" functionality, rather than the extension's (which is {
"key": "f8",
"command": "workbench.action.terminal.runSelectedText"
} As already mentioned, another workaround is interacting with the console after running the selection, like by pressing Esc or Enter. |
This is an oddly specific issue that I am hitting right now, so... bump! I've tried various things and I just cannot get this process to terminate cleanly. Edit: I just realized that this is only when running in VS Code. The work around is fine for me at least, as it's only in debugging situations. |
I just checked with VS Code 1.52.1 and PowerShell 7.1 and, while two orders of magnitude slower than running in PowerShell 7 directly (or the old ISE), the VS Code console instance of pwsh.exe did see exiftool exit and get the return variable from the call populated. Unfortunately this only worked once, immediately after the update of VS Code and PowerShell, and all subsequent attempts have hung indefinitely as previously reported. I wonder if this might perhaps be an indication VS Code is hooking into exiftool's stdout or stderr streams even though the interactions between pwsh.exe and exiftool.exe would, in principle, presumably be encapsulated to those two processed and therefore independent of code.exe. However, I can't think of an explanation for why calling exiftool would only work once after an update. |
@DesertBear Hi there, we just released v2022.4.0-preview! Could you please try PowerShell Preview for VS Code and verify this is fixed? |
This was verified resolved in #3225 (comment) |
This issue has been marked as fixed. It has been automatically closed for housekeeping purposes. |
System Details
System Details Output
Issue Description
When using the Call Operator (&) and using F8 (Run Selection) to run Exiftool (the stand-alone Windows executable HERE), the terminal hangs as if it's waiting for something. This means it's then necessary to click inside the terminal window, and then either press the 'ESC' key (which will then allow Exiftool to run), or press 'CTRL + C' (which will abort the operation).
When using the 'Terminal' menu items in VSCode, Exiftool runs OK without hanging.
To summarise:
Exiftool runs OK when using the following methods.
Menu > Terminal > Run Active File
Menu > Terminal > Run Selected Text
Terminal hangs when using the following methods.
Menu > Run > Start Debugging (F5)
Right-clicking selected text in Editor > Run Selection (F8)
Example code (no paramenters set and assuming the Exiftool executable is saved to desktop):
& "$env:UserProfile\Desktop\exiftool.exe"
Expected Behaviour
The exiftool executable should run without hanging, like it does when using the 'Terminal' menu items.
Screenshot:

Actual Behaviour
The terminal hangs without executing Exiftool, as if waiting for something, until the user intervenes by pressing either 'ESC' or 'CTRL + C' in the Terminal window.
Screenshot:

The text was updated successfully, but these errors were encountered: