-
-
Notifications
You must be signed in to change notification settings - Fork 17
feat: --color
#339
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
Copilot
wants to merge
45
commits into
master
Choose a base branch
from
copilot/add-color-flag-and-mapping
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
feat: --color
#339
Changes from all commits
Commits
Show all changes
45 commits
Select commit
Hold shift + click to select a range
57f5055
Initial plan
Copilot 0bf8a92
Add --color flag and Visualizer coloring support
Copilot eb866f3
Address review feedback: Color enum, minimize const visibility, simpl…
Copilot 80e99c3
Address second review round: rename Colorless→Normal, refactor is_dir…
Copilot 33316ce
Address third review round: ColoredSlice, rename coloring_map/is_dir,…
Copilot f622673
feat: lscolors integration, multi-color support, render_row macro, de…
Copilot c0d0062
refactor: single LazyLock<AnsiPrefixes> + format_args! with row destr…
Copilot 3c22b24
refactor: rename aligned_colored/aligned_normal to aligned_colored_sl…
Copilot 9e47e4d
refactor: consolidate AnsiPrefixes at crate root; Coloring struct; Co…
Copilot ab5cc0a
refactor(r7): rename AnsiPrefixes→LsColors, private fields, restructu…
Copilot bc6faff
refactor(r8): rename field, minimize visibility, move color calc, div…
Copilot 92cede4
test: add predefined LS_COLORS constant to color tests
Copilot 1b2eb7f
Replace unsafe set_var in color_always test with LsColors FromStr
Copilot c78baaa
Address review comments: refactor LsColors, add color test without LS…
Copilot 2c0b44f
fix: rename LsColors::from_str to from_ls_colors_string to fix clippy…
Copilot d78e31e
fix: use full PathBuf key in build_coloring_map to prevent basename c…
Copilot 1d3a5d3
chore: remove dead src/ansi_prefixes.rs file
Copilot 860d755
refactor: address review threads 71-75: remove Hash+Eq bounds, rename…
Copilot 2f6425a
revert: remove color feature flag, make lscolors an unconditional dep…
Copilot bc2f468
refactor: use Vec<OsString> as coloring map keys instead of PathBuf
Copilot 9e97f67
feat: use `from_str`
KSXGitHub d4416d4
refactor: use `.without_env`
KSXGitHub 2580418
fix: fmt
KSXGitHub 34ed31e
style: merge imports
KSXGitHub fdbd102
test: rename a test
KSXGitHub ba3e69f
test: change the workspace
KSXGitHub eb4848f
refactor: shorten an expression
KSXGitHub 415de11
refactor: rearrange
KSXGitHub ac318a9
refactor: correct a name
KSXGitHub 81a548a
perf: reduce unnecessary allocations
KSXGitHub 868c886
refactor: replace qualified path with `use`
KSXGitHub 2543757
refactor: use `.pipe_as_ref`
KSXGitHub b27a943
refactor: rename a variable
KSXGitHub 2311f29
feat: hide some APIs
KSXGitHub 8120a77
refactor: remove `format_args!`
KSXGitHub d09ff5d
refactor: deduplicate code
KSXGitHub 398e43e
docs: add some TODOs
KSXGitHub 2ad9147
docs: missing docs
KSXGitHub cf3e12b
refactor: correct a name
KSXGitHub ade71b1
feat: hide `AnsiPrefix`
KSXGitHub 20d508b
refactor: add some TODOs
KSXGitHub aea511c
test: fix windows
KSXGitHub e7dee6b
refactor: move coloring logic from methods.rs into coloring.rs (#343)
KSXGitHub d0200ef
chore(git): merge from master
KSXGitHub 7d8d39b
chore(git): merge from master
KSXGitHub File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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
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
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When
pduis run with multiple path arguments (e.g.,pdu path1 path2), the code inserts a synthetic root node whose name is later changed from""to"(total)"at line 147, beforebuild_coloring_mapis called at line 203. As a result,build_coloring_mapconstructs paths such as(total)/path1/file.txtand callsfile_coloron them. Since(total)/path1/file.txtdoes not exist on the filesystem,is_symlink(),is_dir(), andis_executable()all returnfalse, and every file gets the defaultColor::Normalcolor — ignoring the actual file type. Symlinks and directories will be miscolored (shown as normal files) whenever--coloris used with multiple path arguments. A fix would be to reconstruct each file's actual path from the child sub-trees before callingfile_color, or to build the coloring map for each sub-tree individually using its original root path.