Skip to content

CMD.EXE does not support UNC paths #14181

Closed

Description

@Bidski

Describe the bug

When monitoring a repository stored inside a WSL2 instance, CMD.EXE is launched with a UNC path which is not supported. Even after choosing Windows Terminal as the shell under Options -> Integrations this still occurs.

Version & OS

Github Desktop: 2.9.11 (x64)
OS: Windows 10 Pro 19042.685

Steps to reproduce the behavior

  1. Have a repo with a pre-commit hook (or any commit hook, my repo has some husky hooks for instance)
  2. Make a commit
  3. Push commit
  4. See error

Expected behavior

Commit hooks run without any issues

Actual behavior

CMD.EXE fails as it doesn't support UNC paths.

Additional context

I think one of the following options needs to be adopted

  1. Github Desktop should default to a terminal that supports UNC paths
  2. Github Desktop should use the shell that is specified in the shell integration, or more control over which shell is launched when using Windows Terminal integration. However, WSL2/Ubuntu is set as the default profile for my Windows Terminal so I am not sure if Github Desktop is honouring this of if it is still just launching Command Prompt inside of Windows Terminal, of if it just ignoring this setting altogether
  3. Better support for repositories stored in WSL2

Activity

  1. johannesschobel commented on Mar 24, 2022

    @johannesschobel

    this would be really nice.. struggling with the same issue.
    Allowing to use UNC paths (i.e., \\wsl$\...) would highly improve the developer experience when working with WSL2

  2. johannesschobel commented on May 4, 2022

    @johannesschobel

    Dear @Bidski , i have found a possible solution for this issue:
    You need to manually create a new Windows registry key:

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor\DisableUNCCheck
    

    with the type DWord and set the value to 1.
    This will then disable the UNC Check for paths.

    The solution worked for me, as i can not execute Husky GitHooks from within GitHub Desktop.

    Hope this helps,
    All the best,

  3. CombesA commented on Jun 8, 2022

    @CombesA

    Dear @Bidski , i have found a possible solution for this issue: You need to manually create a new Windows registry key:

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor\DisableUNCCheck
    

    with the type DWord and set the value to 1. This will then disable the UNC Check for paths.

    The solution worked for me, as i can not execute Husky GitHooks from within GitHub Desktop.

    Hope this helps, All the best,

    This worked like a charm for me, thanks.

  4. corps21 commented on Aug 6, 2023

    @corps21

    Dear @Bidski , i have found a possible solution for this issue: You need to manually create a new Windows registry key:

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor\DisableUNCCheck
    

    with the type DWord and set the value to 1. This will then disable the UNC Check for paths.

    The solution worked for me, as i can not execute Husky GitHooks from within GitHub Desktop.

    Hope this helps, All the best,

    Thanks

  5. Bidski commented on Aug 6, 2023

    @Bidski
    Author

    I would argue that setting an, apparently, undocumented registry value (I am unable to find any documentation describing this value) is an undesirable solution to this problem. But as others have reported that it works and since I no longer use windows (so I am unable to verify this solution personally) I will mark this as closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions