Skip to content

mv: don't prompt to overwrite read-only file when stdin is not a terminal#11346

Open
venoosoo wants to merge 4 commits intouutils:mainfrom
venoosoo:fix-mv-stdin-terminal
Open

mv: don't prompt to overwrite read-only file when stdin is not a terminal#11346
venoosoo wants to merge 4 commits intouutils:mainfrom
venoosoo:fix-mv-stdin-terminal

Conversation

@venoosoo
Copy link
Contributor

@venoosoo venoosoo commented Mar 16, 2026

This is the mv equivalent of #7492, which fixed the same issue for rm.

Changes:

  • prompt_overwrite now skips the prompt when stdin is not a terminal and OverwriteMode is Default (implicit read-only protection), matching GNU mv behavior
  • Added test test_mv_no_prompt_when_stdin_not_terminal

Fixes #11321

@github-actions
Copy link

GNU testsuite comparison:

Skipping an intermittent issue tests/tail/inotify-dir-recreate (passes in this run but fails in the 'main' branch)
Note: The gnu test tests/tail/tail-n0f is now being skipped but was previously passing.
Congrats! The gnu test tests/printf/printf-surprise is now passing!
Congrats! The gnu test tests/seq/seq-epipe is now passing!

@codspeed-hq
Copy link

codspeed-hq bot commented Mar 16, 2026

Merging this PR will not alter performance

✅ 298 untouched benchmarks
⏩ 48 skipped benchmarks1


Comparing venoosoo:fix-mv-stdin-terminal (658f428) with main (bc58d3d)

Open in CodSpeed

Footnotes

  1. 48 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@oech3
Copy link
Contributor

oech3 commented Mar 16, 2026

Please remove the hidden flag or restrict to debug build.

@github-actions
Copy link

GNU testsuite comparison:

Skipping an intermittent issue tests/date/date-locale-hour (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/pr/bounded-memory (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/tail/inotify-dir-recreate (passes in this run but fails in the 'main' branch)
Congrats! The gnu test tests/printf/printf-surprise is now passing!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mv: prompts to overwrite read-only file when stdin is not a terminal

2 participants