Repository navigation
Description
System Details
System Details Output
### VSCode version: 1.43.0 78a4c91400152c0f27ba4d363eb56d2835f9903a x64
### VSCode extensions:
[email protected]
### PSES version: 2.0.0.0
### PowerShell version:
Name Value
---- -----
PSVersion 7.0.0
PSEdition Core
GitCommitId 7.0.0
OS Microsoft Windows 10.0.18363
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
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.
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.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone


Activity
SydneyhSmith commentedon Mar 17, 2020
It would be really helpful if you could also attach the logs--instructions for how to do that are here
DesertBear commentedon Mar 27, 2020
Log files attached:
Logs.zip
VSCode settings:
settings.zip
twest820 commentedon Apr 11, 2020
+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.
rjmholt commentedon Apr 14, 2020
I just managed to look into this, and got a repro on my machine specifically with
exiftool.exe. The call operator isn't an influence here, since running the tool directly has the same effect.I suspected this might be an issue with the integrated terminal interacting with
more, butmore .\longfile.txtandhelp Get-Help -Fullboth work as expected.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
$PSScriptRootaware). To do this with F8, set this keybinding configuration:{ "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.
[-]PowerShell Hangs In VSCode When Using Call Operator (&) And Using F8 To Run Selection[/-][+]exiftool.exe hangs on Run Selection (F8)[/+]4 remaining items
andyleejordan commentedon Apr 12, 2022
DesertBear Hi there, we just released v2022.4.0-preview! Could you please try PowerShell Preview for VS Code and verify this is fixed?
andyleejordan commentedon Apr 13, 2022
This was verified resolved in #3225 (comment)