{"record":{"id":"9964a2d8606b92ec","repo":"gitbutlerapp/gitbutler","slug":"could-not-determine-which-accounts-to-delete","errorCode":null,"errorMessage":"Could not determine which accounts to delete","messagePattern":"Could not determine which accounts to delete","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/but/src/command/config.rs","lineNumber":1322,"sourceCode":"        }\n        _ => {\n            // Multiple accounts: prompt user to select\n            let Some(mut input) = out.prepare_for_terminal_input() else {\n                anyhow::bail!(\"Username ambiguous, got {accounts_to_delete:?}\");\n            };\n            let account_options = accounts_to_delete\n                .into_iter()\n                .map(|account| (account.to_string(), account))\n                .collect::<Vec<_>>();\n            let account_options = nonempty::NonEmpty::from_vec(account_options)\n                .context(\"No accounts available to forget\")?;\n\n            let selected_accounts = input\n                .prompt_multi_select(\n                    \"Which of the following accounts do you want to forget?\",\n                    &account_options,\n                )?\n                .ok_or_else(|| anyhow::anyhow!(\"Could not determine which accounts to delete\"))?;\n\n            if selected_accounts.is_empty() {\n                writeln!(input, \"No accounts were selected to forget.\")?;\n                return Ok(());\n            }\n\n            for account in selected_accounts {\n                forget_account(account)?;\n                writeln!(input, \"Forgot forge account '{account}'\")?;\n            }\n        }\n    }\n\n    Ok(())\n}\n\nfn ai_config_with_repo(\n    ctx: &mut Context,","sourceCodeStart":1304,"sourceCodeEnd":1340,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/58e5313667b857ef39a730e380af31816a7b1768/crates/but/src/command/config.rs#L1304-L1340","documentation":"In `but config forge-forget`, the interactive multi-select prompt (`prompt_multi_select`) returned `None` instead of a selection list. The `but` CLI treats a non-answer (typically a cancelled or non-interactive prompt) as an unrecoverable condition and raises this anyhow error, since it cannot proceed to delete accounts without knowing which ones to forget.","triggerScenarios":"Running `but config forge-forget` in an environment where the multi-select prompt cannot return a value: stdin is not a TTY (piped/ci), the user aborts the prompt (Ctrl-C/Esc handled as None), or the prompt backend fails to render and yields None. The error fires before the empty-selection check.","commonSituations":"Running the command from scripts, CI, or non-interactive shells where no terminal prompt UI is available; terminal multiplexer or unusual TERM settings breaking the interactive picker; users cancelling the dialog expecting a graceful exit but getting a hard error.","solutions":["Run the command in an interactive terminal with a working TTY so the multi-select can render","Do not cancel the prompt; select zero accounts and confirm to get the graceful 'No accounts were selected' path instead","Pipe no input is unsupported; use a pty wrapper (e.g. `script -c` or expect) if automation is needed","Verify terminal supports the interactive prompt library (correct TERM, no broken crossterm input)"],"exampleFix":"// before: running non-interactively fails\necho | but config forge-forget  # Error: Could not determine which accounts to delete\n\n// after: run interactively, or explicitly decline via empty selection\nbut config forge-forget   # in a real TTY; press Enter with none selected to exit cleanly","handlingStrategy":"try-catch","validationCode":"// shell: ensure interactive TTY before invoking\nif [ ! -t 0 ]; then echo \"refusing: requires interactive terminal\"; exit 1; fi","typeGuard":null,"tryCatchPattern":"match but::config_forget_accounts() {\n    Err(e) if e.to_string().contains(\"Could not determine which accounts\") => {\n        eprintln!(\"Prompt was cancelled or non-interactive; no accounts deleted.\");\n    }\n    r => r?,\n}","preventionTips":["Only run account-forget interactively with a real TTY","Prefer non-interactive flags or direct config edits in scripts","Treat Ctrl-C at prompts as cancelling the whole command"],"tags":["cli","interactive-prompt","non-interactive-terminal"],"backgroundTag":"missing-cli-argument","analyzedSha":"58e5313667b857ef39a730e380af31816a7b1768","analyzedAt":"2026-09-18T06:50:32.052Z","contentChangedAt":"2026-09-18T06:50:32.052Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}