{"record":{"id":"da714aa963606c5b","repo":"flxzt/rnote","slug":"file-conflict-for-file-detected-and-terminal","errorCode":null,"errorMessage":"File conflict for file \"{}\" detected and terminal is not interactive. Option \"--on-conflict\" needs to be supplied.","messagePattern":"File conflict for file \"(.+?)\" detected and terminal is not interactive\\. Option \"--on-conflict\" needs to be supplied\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/rnote-cli/src/export.rs","lineNumber":458,"sourceCode":") -> anyhow::Result<Option<PathBuf>> {\n    if !output_file.exists() {\n        return Ok(None);\n    }\n    match on_conflict_overwrite {\n        Some(o) => on_conflict = *o,\n        None => {\n            let options = &[\n                OnConflict::Ask,\n                OnConflict::Overwrite,\n                OnConflict::AlwaysOverwrite,\n                OnConflict::Skip,\n                OnConflict::AlwaysSkip,\n                OnConflict::Suffix,\n                OnConflict::AlwaysSuffix,\n            ];\n            while matches!(on_conflict, OnConflict::Ask) {\n                if !io::stdout().is_terminal() {\n                    return Err(anyhow::anyhow!(\n                        \"File conflict for file \\\"{}\\\" detected and terminal is not interactive. Option \\\"--on-conflict\\\" needs to be supplied.\",\n                        output_file.display()\n                    ));\n                }\n                match dialoguer::Select::new()\n                    .with_prompt(format!(\n                        \"File \\\"{}\\\" already exists:\",\n                        output_file.display()\n                    ))\n                    .items(options)\n                    .default(1)\n                    .interact()\n                {\n                    Ok(0) => cli::open_file_default_app(output_file)?,\n                    Ok(c) => on_conflict = options[c],\n                    Err(e) => {\n                        return Err(anyhow::anyhow!(\n                            \"Failed to show select prompt, retry or select the behavior with\\\"--on-conflict\\\", Err: {e:?}\"","sourceCodeStart":440,"sourceCodeEnd":476,"githubUrl":"https://github.com/flxzt/rnote/blob/bbc5354502ba2fc83eec2670b535348825e679a6/crates/rnote-cli/src/export.rs#L440-L476","documentation":"Guard in file_conflict_prompt_action: an export output file already exists and OnConflict::Ask was requested, but stdout is not a TTY, so the interactive dialoguer prompt cannot be shown. Fires when running the CLI non-interactively (pipes, CI, scripts) without an explicit --on-conflict option.","triggerScenarios":"Thrown at crates/rnote-cli/src/export.rs:458 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Re-run with an explicit --on-conflict value such as overwrite, skip, or suffix.","Use --on-conflict always-skip or always-overwrite to avoid prompts for every page.","Run in an interactive terminal if you want the per-file prompt."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"bbc5354502ba2fc83eec2670b535348825e679a6","analyzedAt":"2026-09-08T13:20:33.747Z","contentChangedAt":"2026-09-08T13:20:33.747Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}