Improved newline handling#2633
Open
valoq wants to merge 11 commits into
Open
Conversation
Contributor
Author
|
The replacement character is still unchanged but the PR feels ready for review now. (though intended for after r42) (I will squash the commits before merge but we need to wait for the release and a decision on #2633 first anyway) |
valoq
marked this pull request as ready for review
July 8, 2026 18:24
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Picking up the discussion from #2630
This PR cleans up and refactors the handling of newlines in filenames and implements the recommendations from POSIX.1-2024
One thing to discuss and decide for this PR is how to display newlines, which was already mentioned in #2505
Here are some obvious options:
The current PR behavior:
The proposal from #2505
With ASCII names:
How coreutils "ls" displays it
How "lsd" displays it:
Displaying the different escape sequences seems better then replacing them all with the same "illegal character" symbol, at least for these four that actually matter. The symbols proposed in #2505 seem really small, but maybe thats just me? (can anyone confirm this is how it shows up too?)
The display from "lsd" is what I would prefer but we would need to escape that and this adds its own problems, which leaves the ASCII name display as my personal preferred solution since its the most readable.