Skip to content

fix: copy loop when pasting into copied path#2607

Closed
valoq wants to merge 1 commit into
gokcehan:masterfrom
valoq:copyself
Closed

fix: copy loop when pasting into copied path#2607
valoq wants to merge 1 commit into
gokcehan:masterfrom
valoq:copyself

Conversation

@valoq

@valoq valoq commented May 31, 2026

Copy link
Copy Markdown
Contributor

Pasting a folder into one of its own subdirectories caused the copy function to loop and recurse.
This skips the destination directory, so the copy is a one-time snapshot of the source.

The alternative as done by coreutils cp would be to fail the attempt to copy inside the yanked path, but this is simpler (and less code) and there may be use cases to allow this.

Note to trigger the issue, paste to a subdirectory not directly into the copied patch because the later often gets lucky and succeeds while pasting into sub dirs reliably crashes the application with error.

@valoq

valoq commented Jun 3, 2026

Copy link
Copy Markdown
Contributor Author

I would like to support this use case, but:

  1. Im not sure its needed
  2. There are a few cases in combination with move where this may break rare use cases.

so for now, I think #2608 is the right, most simple check for the current release and we could revisit this afterwards.

@valoq valoq closed this Jun 3, 2026
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.

1 participant