git-ecosystem/git-credential-manager · info · Exception
User cancelled dialog.
Error message
User cancelled dialog.
What it means
SelectAccountCommand's ExecuteAsync shows an account-selection dialog after listing stored GitHub accounts. If the window is closed without picking an account (WindowResult false), it throws a plain Exception with this message because no account can be written to the result.
Solutions
- Re-run the command and explicitly select an account, then confirm the dialog.
- Remove unwanted stored accounts ('git-credential-manager github logout') so the picker is not needed.
- Specify the account/username up front in the git URL (e.g. https://username@github.com/owner/repo.git) to bypass the picker.
- Catch the exception in tooling and treat it as 'no account chosen'.
Defensive patterns
Strategy: try-catch
Validate before calling
var accounts = run("git-credential-manager github list");
if (accounts.Split('\n', StringSplitOptions.RemoveEmptyEntries).Length > 1)
{
// multiple accounts: embed the desired user in the remote URL to skip the picker
} Try / catch
try
{
await selectAccountCommand.ExecuteAsync(input, output);
}
catch (Exception ex) when (ex.Message == "User cancelled dialog.")
{
// no account chosen; fall back to username-in-URL or re-prompt
} Prevention
- Embed the username in the remote URL (https://user@github.com/...) to avoid the account picker
- Log out unused GitHub accounts to keep a single stored account
- Complete the picker dialog rather than closing it
- In scripts, catch the exception and prompt for the account explicitly
When it happens
Trigger: Running the select-account command when multiple GitHub accounts are stored and the user cancels or closes the account picker dialog without selecting one.
Common situations: Users with several GitHub accounts dismissing the picker; automation that cannot render the dialog; users wanting to add a new account but cancelling instead.
Related errors
- User cancelled dialog.
- User cancelled dialog.
- User cancelled dialog.
- User canceled device code authentication
- User cancelled dialog.
AI-assisted analysis of git-ecosystem/git-credential-manager@e8ce762cd0 (2026-09-11).
Data as JSON: /api/errors/039fba25e1e2e9de.
Report an issue: GitHub.
Appendix: source
Thrown at src/GitHub/UI/Commands/SelectAccountCommand.cs:41
this.SetHandler(ExecuteAsync, url, noHelp);
}
private async Task<int> ExecuteAsync(string enterpriseUrl, bool noHelp)
{
// Read accounts from standard input
IList<string> accounts = ReadAccounts();
var viewModel = new SelectAccountViewModel(Context.SessionManager, accounts)
{
EnterpriseUrl = enterpriseUrl,
ShowHelpLink = !noHelp
};
await ShowAsync(viewModel, CancellationToken.None);
if (!viewModel.WindowResult)
{
throw new Exception("User cancelled dialog.");
}
WriteResult(new Dictionary<string, string>
{
["account"] = viewModel.SelectedAccount?.UserName
});
return 0;
}
private IList<string> ReadAccounts()
{
var accounts = new List<string>();
string line;
while (!string.IsNullOrWhiteSpace(line = Context.Streams.In.ReadLine()))
{
accounts.Add(line.Trim());View on GitHub (pinned to e8ce762cd0)