Skip to content

macOS: opening documents by file path only is broken #18181

Closed

Description

Prerequisites

Steps to reproduce

The following is currently broken on macOS 12.6:

'hi' > t.txt
./t.txt  # !! Nothing happens.

Note that Invoke-Item ./t.txt works.

Expected behavior

./t.txt should open in the default text editor.

Actual behavior

Nothing happens.

Error details

No response

Environment data

PowerShell Core 7.3.0-preview.8 (also present in 7.2.6) on macOS 12.6 (M1)

Visuals

No response

Activity

  1. added
    Needs-Triage
    on Sep 28, 2022
  2. dkaszews commented on Sep 28, 2022

    @dkaszews
    Contributor

    I'll need to check it, but on Windows I always use Start-Process ./t.txt to open file in default program, I assumed that just ./t.txt would throw an equivalent of "file is not executable"

  3. SteveL-MSFT commented on Oct 3, 2022

    @SteveL-MSFT
    Member

    I'm debugging this and on macOS, UseShellExecute is being set correctly as the file is not executable. Not sure yet why it's not working as expected.

  4. SteveL-MSFT commented on Oct 3, 2022

    @SteveL-MSFT
    Member

    It seems this works in 7.1, but stopped working in 7.2. Checking to see what changed in .NET.

  5. StevenBucher98 commented on Oct 3, 2022

    @StevenBucher98
    Collaborator

    I'll need to check it, but on Windows I always use Start-Process ./t.txt to open file in default program, I assumed that just ./t.txt would throw an equivalent of "file is not executable"

    When you do ./t.txt it opens in notepad, also able to reproduce this on my mac, nothing happens.

  6. added
    Issue-Bug
    WG-DevEx-Portability
    on Oct 3, 2022
  7. SteveL-MSFT commented on Oct 4, 2022

    @SteveL-MSFT
    Member

    Took a bit of time going through different versions of pwsh to find out where the regression was introduced and it was in 7.2-preview.6. It appears that the process is being started, but then immediately killed. I'll have a fix.

  8. ghost added
    In-PR
    on Oct 4, 2022
  9. dkaszews commented on Oct 4, 2022

    @dkaszews
    Contributor

    Steve Lee (@SteveL-MSFT) Good job hunting it down. BTW, did you do it manually or use git bisect? It's an awesome tool not many people know about, you give it a passing and failing commit and a test script (here: compile, run test line, detect process started or prompt user to say whether case passes if it's too difficult to automate) and it finds the breaking chang
    e with log2(n) steps.

  10. ghost removed
    In-PR
    on Oct 7, 2022
  11. ghost added
    Resolution-Fixed
    on Oct 7, 2022
  12. ghost removed
    Needs-Triage
    on Oct 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Issue-BugResolution-FixedWG-DevEx-Portability

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions