Skip to content

flutter command line causes cmd window to close on windows when git is missing #169784

Closed

Description

@abitofevrything

We've recently had quite a few people with installation problems over on the FlutterDev discord report that running any flutter command causes their cmd window to close. This, of course, only happens on Windows.

We narrowed it down to the fact that shared.bat uses the EXIT command without /B in several places, causing the entire cmd window to close. Seeing as this is often used immediately after reporting an error, this means users never get a chance to see the actual error message.

We've seen this from people trying to run flutter without Git in their path, or without PowerShell in their path, but there may be other cases that can trigger the issue.

This can be worked around by spawning another CMD shell within the existing CMD prompt, then running flutter inside that - which causes the nested CMD to exit, but the parent CMD remains so the error message is visible.

I'm not actually on a Windows system so I'm unable to provide detailed reproduction steps, or information on whether this occurrs in PowerShell or not.

Activity

  1. added
    in triagePresently being triaged by the triage team
    toolAffects the "flutter" command-line tool. See also t: labels.
    platform-windowsBuilding on or for Windows specifically
    team-toolOwned by Flutter Tool team
    and removed
    in triagePresently being triaged by the triage team
    on Jun 2, 2025
  2. flutter-triage-bot commented on Jun 2, 2025

    @flutter-triage-bot

    This issue is missing a priority label. Please set a priority label when adding the triaged-tool label.

  3. added a commit that references this issue on Jun 9, 2025
  4. github-actions commented on Jun 19, 2025

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  5. locked as resolved and limited conversation to collaborators on Jun 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

platform-windowsBuilding on or for Windows specificallyteam-toolOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.waiting for PR to land (fixed)A fix is in flight

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions