Skip to content
This repository was archived by the owner on Mar 3, 2023. It is now read-only.
This repository was archived by the owner on Mar 3, 2023. It is now read-only.

Copy-paste doesn't work properly with Unix-style line endings under Windows #8365

@kovbal

Description

@kovbal

Copying (Ctrl+C-Ctrl+V) from a file with Unix-style line ending (LF) doesn't work as expected, since line endings are preserved on the clipboard.

This causes a wide range of issues:

  • you can't paste text in an application that doesn't handle LF (notepad for example, but if you're using vim over PuTTY that also doesn't work)
  • even if the other app handles LF, you have to be consistent, so you can't paste text from an CRLF file into a LF one or vice versa

This issue is briefly discussed in #2822, and it is the reason of #5808.

All other editors convert line endings in text placed on the clipboard (Sublime Text, jEdit, etc.), so in this regard Atom behaves rather strangely compared to other editors.

The proposed solution in #2822 (configurable line endings) is insufficient since it's based on the assumption that all files edited by the user are using the same line ending.
For example, if I've got a file with LF line endings and I'd like to use copy-paste, then I have to convert it to CRLF and then copy the text I want, and then convert it back to LF to preserve the original format. I wouldn't call editing LF files on Windows a rare use case, especially among Atom's users.

Atom should convert any text's line ending to the platform's native line ending before it is placed on the clipboard. This conversion should only be done on the content that is placed on the clipboard—the text in the buffer should not be changed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions