Skip to content

exiftool.exe hangs on Run Selection (F8) #2559

Closed

Description

@DesertBear

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.

Screenshot:
Screenshot B

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:
Screenshot A

Activity

  1. ghost added
    Needs: Triage
    on Mar 15, 2020
  2. SydneyhSmith commented on Mar 17, 2020

    @SydneyhSmith
    Collaborator

    It would be really helpful if you could also attach the logs--instructions for how to do that are here

  3. added and removed
    Needs: Triage
    on Mar 17, 2020
  4. DesertBear commented on Mar 27, 2020

    @DesertBear
    Author

    Log files attached:

    Logs.zip

    VSCode settings:

    settings.zip

  5. ghost added
    Needs: Maintainer Attention
    on Mar 27, 2020
  6. added
    Issue-Bug
    and removed
    Needs: Maintainer Attention
    on Mar 31, 2020
  7. twest820 commented on Apr 11, 2020

    @twest820

    +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.

    ### VSCode version: 1.43.2 0ba0ca52957102ca3527cf479571617f0de6ed50 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.18362
    Platform                       Win32NT
    PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
    PSRemotingProtocolVersion      2.3
    SerializationVersion           1.1.0.1
    WSManStackVersion              3.0
    
  8. ghost added
    Needs: Maintainer Attention
    on Apr 11, 2020
  9. rjmholt commented on Apr 14, 2020

    @rjmholt
    Contributor

    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, but more .\longfile.txt and help Get-Help -Full both 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 $PSScriptRoot aware). 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.

  10. changed the title [-]PowerShell Hangs In VSCode When Using Call Operator (&) And Using F8 To Run Selection[/-] [+]exiftool.exe hangs on Run Selection (F8)[/+] on Apr 14, 2020
  11. 4 remaining items

  12. moved this from Todo to In Progress in Sea Biscuiton Apr 12, 2022
  13. andyleejordan commented on Apr 12, 2022

    @andyleejordan
    Member

    DesertBear Hi there, we just released v2022.4.0-preview! Could you please try PowerShell Preview for VS Code and verify this is fixed?

  14. andyleejordan commented on Apr 13, 2022

    @andyleejordan
    Member

    This was verified resolved in #3225 (comment)

  15. added
    Resolution-Fixed
    and removed
    Needs: Fix Verification
    on Apr 13, 2022
  16. moved this from In Progress to Done in Sea Biscuiton Apr 13, 2022
  17. ghost closed this as completedon Apr 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-Extension TerminalIssue-BugResolution-Fixed

    Type

    No type

    Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions