Skip to content

Option to auto-rename on name conflicts instead of showing the conflict dialog (keep both) #3861

Open

Description

@kokingen

Hi! When copying/moving/dragging files into a folder that already has an item with the same name, Nemo always shows the conflict dialog. Many users coming from macOS/Windows expect a "keep both" behaviour: the incoming file is renamed automatically (e.g. "report (copy).pdf") and same-named folders are merged, without any prompt.

I wrote a patch against Nemo 6.6.3 that does this and have been using it daily on Linux Mint 22.3:

  • file conflict -> incoming item renamed with the existing "(copy)" naming logic
  • folder conflict -> merge, conflicting files inside renamed the same way
  • the existing target is never overwritten or deleted
  • works for drag & drop, Ctrl+C/Ctrl+V, the desktop, cut/move and cross-filesystem copies
  • tested with an automated suite (35 cases, 3 runs) plus manual GUI testing

Right now it is switched off with an environment variable (NEMO_NO_AUTORENAME=1). If you're interested, I'd be happy to turn it into a proper opt-in preference and open a PR.

Patch and builds: https://github.com/kokingen/linux-file-autorename

Side note, a small separate bug I found while doing this: in nemo-file-operations.c the copy-name parser calls eel_filename_get_extension_offset (name + 1), but that function already skips the first character, so one-letter names lose their extension ("m.txt" becomes "m.txt (copy)" instead of "m (copy).txt"). Passing name instead fixes it; it's included in the patch above.

Thanks for Nemo!

Activity

  1. Jeremy7701 commented on Oct 16, 2026

    @Jeremy7701
    Contributor

    I'd like to keep the current behaviour.

    Note that just because two files have the same name, it doesn't mean they are duplicates.

  2. kokingen commented on Oct 17, 2026

    @kokingen
    Author

    Thanks for taking a look, Jeremy, and I completely agree that two files with the same name aren't necessarily duplicates. That's exactly why this proposal never overwrites or deletes anything: on a conflict it keeps both files and gives the incoming one a new name, e.g. "report (copy).txt", so the original is always preserved.

    This is how macOS Finder (and Windows) handle copies into the same folder: the copy gets an automatic name and the operation just completes, with no dialog interrupting it. For people who copy files around a lot, the conflict dialog popping up again and again breaks the flow, especially in large batch copies where you just want everything to land safely.

    To be clear, I'm not asking to change the default. Something like an opt-in setting (off by default) would keep the current behaviour for everyone, while letting users who prefer the "always keep both" approach turn it on:

    Preferences > Behavior > When a file with the same name exists: [Ask (default)] / [Keep both, auto-rename]
    

    I already have a working patch (tested on Linux Mint 22.3 with copy/paste, drag and drop, move, the desktop, and cross-device copies), and I'd be happy to turn it into a proper GSettings option and open a PR if you're open to it.

    Separately, the single-letter filename bug mentioned above ("m.txt" producing a wrongly placed extension) is independent of this feature, and I can send a small fix for just that if useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions