github / github/app

Terminal crashes with Exit 126 and unsigned script errors on Windows 11 Enterprise

Offen
#3,064 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
triage
Vorherrschende Sprache
Keine Sprachdaten
Sterne
2.1k
Forks
153
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

### Short summary

The GitHub Copilot Desktop integrated terminal fails to initialize in locked-down Windows 11 Enterprise environments. The application attempts to force-inject an unsigned PowerShell script (shellIntegration.ps1), which is blocked by system security policies. Additionally, standard MSYS2/MinGW64 binaries crash with Exit Code 126 because the app passes the project directory as an execution argument rather than a working directory context.

### Affected version or release

v1.1.11

### Installation context

Windows 11 Enterprise; MSYS2 / MinGW64 (standard installation at C:\msys64); local git worktrees

### What happened?

- _Security Error:_ PowerShell blocks `shellIntegration.ps1` because it is not digitally signed, triggering an UnauthorizedAccess exception due to corporate Execution Policies.
- _Execution Crash:_ Pointing the terminal to `bash.exe` or `mingw64.exe` results in a crash with `Exit Code 126 ("Is a directory")`. **The shell attempts to execute the repository folder path passed as a command-line argument.**
- _Architecture Mismatch:_ Attempts to use custom-compiled C# wrappers often result in `OS Error 193 ("%1 is not a valid Win32 application")` if there is any mismatch in the background process host architecture.

### Steps to reproduce

1. Open GitHub Copilot Desktop on **Windows 11 Enterprise.**
2. Navigate to a project folder _(e.g., C:\Users\user\github\)_
3. Set the custom terminal path to `C:\msys64\mingw64.exe`
4. Open the integrated terminal panel.
5. Observe the crash _(Exit 126)_ or the red PowerShell script-signing error text.

### Expected behavior

The terminal should open a clean, interactive MinGW64 shell initialized at the project's root directory without attempting to run the directory as a command or triggering unsigned script blocks.

### Additional context

_!! Resolution / Workaround (The "Stub" Method): !!_

**The issue is fully resolved by utilizing Windows Terminal as a bridge, which handles the initialization sequence outside of Copilot's restrictive process manager.**

1. Create Custom Profile: In Windows Terminal, create a new profile (e.g., named git-bash).
2. Set Command Line: Set the command line to C:\msys64\mingw64.exe
3. Set as Default: In Windows Terminal startup settings, set this new profile as the Default profile.
4. Launch via Copilot: GitHub Copilot Desktop now spawns a "dummy/stub" via Windows Terminal, which successfully opens the native MSYS2 window without crashing.

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Start by reproducing the failure with C:\msys64\mingw64.exe on Windows 11 Enterprise, then trace the integrated terminal launch path and its handling of shellIntegration.ps1. Done means an interactive MinGW64 shell opens at the project root without treating the directory as a command or triggering unsigned-script blocks.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
powershell, shell
Bereich
cli, desktop
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Aktiv
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
45/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.