flxzt/rnote · error

File conflict for file

Error message

File conflict for file "{}" detected and terminal is not interactive. Option "--on-conflict" needs to be supplied.

What it means

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.

Solutions

  1. Re-run with an explicit --on-conflict value such as overwrite, skip, or suffix.
  2. Use --on-conflict always-skip or always-overwrite to avoid prompts for every page.
  3. Run in an interactive terminal if you want the per-file prompt.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/rnote-cli/src/export.rs:458 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of flxzt/rnote@bbc5354502 (2026-09-08). Data as JSON: /api/errors/da714aa963606c5b. Report an issue: GitHub.

Appendix: source

Thrown at crates/rnote-cli/src/export.rs:458

) -> anyhow::Result<Option<PathBuf>> {
    if !output_file.exists() {
        return Ok(None);
    }
    match on_conflict_overwrite {
        Some(o) => on_conflict = *o,
        None => {
            let options = &[
                OnConflict::Ask,
                OnConflict::Overwrite,
                OnConflict::AlwaysOverwrite,
                OnConflict::Skip,
                OnConflict::AlwaysSkip,
                OnConflict::Suffix,
                OnConflict::AlwaysSuffix,
            ];
            while matches!(on_conflict, OnConflict::Ask) {
                if !io::stdout().is_terminal() {
                    return Err(anyhow::anyhow!(
                        "File conflict for file \"{}\" detected and terminal is not interactive. Option \"--on-conflict\" needs to be supplied.",
                        output_file.display()
                    ));
                }
                match dialoguer::Select::new()
                    .with_prompt(format!(
                        "File \"{}\" already exists:",
                        output_file.display()
                    ))
                    .items(options)
                    .default(1)
                    .interact()
                {
                    Ok(0) => cli::open_file_default_app(output_file)?,
                    Ok(c) => on_conflict = options[c],
                    Err(e) => {
                        return Err(anyhow::anyhow!(
                            "Failed to show select prompt, retry or select the behavior with\"--on-conflict\", Err: {e:?}"

View on GitHub (pinned to bbc5354502)