{"record":{"id":"90ea5d3120372913","repo":"jdx/mise","slug":"not-connected-choose-sync-manual-sync-sync","errorCode":null,"errorMessage":"not connected: choose --sync manual, --sync sync, or --sync fetch-only to connect without a mode prompt","messagePattern":"not connected: choose --sync manual, --sync sync, or --sync fetch-only to connect without a mode prompt","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cli/dotfiles/origin.rs","lineNumber":104,"sourceCode":"        if !crate::config::Settings::get().history.enabled {\n            bail!(\"history is disabled (history.enabled = false)\");\n        }\n        let mode = match self.sync.as_deref() {\n            Some(mode) => SyncMode::parse(mode)?,\n            None if self.yes || crate::config::Settings::get().yes => SyncMode::current()?,\n            None => match crate::ui::prompt::confirm_with_default(\n                \"Automatically publish saved edits AND apply incoming changes to live files? Choose no for manual sharing; local autosave continues in either mode.\",\n                false,\n            )? {\n                crate::ui::prompt::Confirmation::Yes => SyncMode::Sync,\n                crate::ui::prompt::Confirmation::No => SyncMode::Manual,\n                crate::ui::prompt::Confirmation::Unanswered => {\n                    bail!(\n                        \"not connected: stdin ended before an answer; choose --sync manual, --sync sync, or --sync fetch-only\"\n                    );\n                }\n                crate::ui::prompt::Confirmation::Unavailable => {\n                    bail!(\n                        \"not connected: choose --sync manual, --sync sync, or --sync fetch-only to connect without a mode prompt\"\n                    );\n                }\n            },\n        };\n        let (store, tracked, _) = super::history::open().await?;\n        if let Some(reason) = store.unavailable() {\n            bail!(\"cannot connect a setup repository: {reason}\");\n        }\n        origin::set(\n            &store,\n            &tracked,\n            &origin::SetOptions {\n                url: self.url.clone(),\n                branch: self.branch.clone(),\n                mode,\n                yes: self.yes,\n            },","sourceCodeStart":86,"sourceCodeEnd":122,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/cli/dotfiles/origin.rs#L86-L122","documentation":"Same command as the Unanswered case, but for `Confirmation::Unavailable` — the prompt subsystem cannot ask at all (no interactive input available), so `mise dot origin set` bails instead of picking a sync mode implicitly.","triggerScenarios":"Running `mise dot origin set` without `--sync` and without `--yes` in an environment where prompting is unavailable (no TTY / prompts disabled), so confirm_with_default returns Unavailable.","commonSituations":"CI jobs and Docker containers without a TTY; IDE-embedded terminals where prompt detection fails; wrapping scripts that redirect stdin/stdout.","solutions":["Always pass `--sync manual|sync|fetch-only` when running non-interactively","Use `--yes` to accept the default (current) mode without prompting, if that is desired","Allocate a TTY (e.g. `script -qec` in CI) if you truly want the interactive prompt"],"exampleFix":"// before (in CI)\nmise dot origin set $DOTFILES_URL\n// after\nmise dot origin set $DOTFILES_URL --sync fetch-only","handlingStrategy":"validation","validationCode":"if [ ! -t 0 ]; then\n  set -- \"$@\" --sync fetch-only   # non-interactive default\nfi","typeGuard":null,"tryCatchPattern":"if ! mise dot origin set \"$URL\"; then\n  mise dot origin set \"$URL\" --sync manual\nfi","preventionTips":["Always pass --sync in non-TTY environments","Allocate a TTY in CI if interactivity is required","Standardize origin-set invocations with an explicit mode","Keep --yes out of scripts that should not change modes implicitly"],"tags":["cli","dotfiles","tty","non-interactive","prompt"],"backgroundTag":"missing-required-flag","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}