Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/UPSTREAM_TRIAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ Work an unread upstream report in this order:
| [#1002](https://github.com/eza-community/eza/issues/1002), [#745](https://github.com/eza-community/eza/issues/745) | High stat overhead on empty directory glyph probing over FUSE/NFS. `LEZ_NO_EMPTY_DIR_ICON` avoids probing. |
| [#1732](https://github.com/eza-community/eza/issues/1732) | `--size-digits=<NUM>` (alias `--digits`) and `LEZ_SIZE_DIGITS` added to customize size column precision/digit count. |
| [#728](https://github.com/eza-community/eza/issues/728), [#730](https://github.com/eza-community/eza/pull/730), [#1791](https://github.com/eza-community/eza/pull/1791) | Cohesive full-path quoting (`'/path/with spaces/file.txt'`) and configurable quote styling via `qu` code in `LEZ_COLORS` & `theme.yml`. |
| [#1940](https://github.com/eza-community/eza/issues/1940), [#1943](https://github.com/eza-community/eza/pull/1943) | Four `FILENAME_ICONS` entries (`.atom`, `.idea`, `.rvm`, `.zsh_sessions`) unreachable because names are directories. Moved to `DIRECTORY_ICONS`. |

### Reproduced but Still Open / By Design

Expand Down
22 changes: 18 additions & 4 deletions src/output/icons.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,14 +189,18 @@ impl Icons {
/// Mapping from full filenames to directory icon. This mapping should contain
/// all the directories that have a custom icon.
const DIRECTORY_ICONS: Map<&'static str, char> = phf_map! {
".atom" => '\u{e764}', // 
".config" => Icons::FOLDER_CONFIG, // 
".exercism" => Icons::FOLDER_EXERCISM, // 
".git" => Icons::FOLDER_GIT, // 
".github" => Icons::FOLDER_GITHUB, // 
".idea" => Icons::INTELLIJ, // 
".npm" => Icons::FOLDER_NPM, // 
".opam" => Icons::FOLDER_OCAML, // 
".rvm" => Icons::LANG_RUBY, // 
".ssh" => Icons::FOLDER_KEY, // 󰢬
".Trash" => Icons::FOLDER_TRASH, // 
".zsh_sessions" => Icons::SHELL, // 󱆃
"build" => Icons::FOLDER_BUILD, // 󱧼
"config" => Icons::FOLDER_CONFIG, // 
"Contacts" => Icons::FOLDER_CONTACTS, // 󰉌
Expand Down Expand Up @@ -236,7 +240,6 @@ const DIRECTORY_ICONS: Map<&'static str, char> = phf_map! {
/// all the "dot" files that have a custom icon.
const FILENAME_ICONS: Map<&'static str, char> = phf_map! {
".aliases" => Icons::SHELL, // 󱆃
".atom" => '\u{e764}', // 
".bashrc" => Icons::SHELL, // 󱆃
".bash_aliases" => Icons::SHELL, // 󱆃
".bash_history" => Icons::SHELL, // 󱆃
Expand Down Expand Up @@ -271,7 +274,6 @@ const FILENAME_ICONS: Map<&'static str, char> = phf_map! {
".gvimrc" => Icons::VIM, // 
".htaccess" => Icons::CONFIG, // 󱁻
".htpasswd" => Icons::CONFIG, // 󱁻
".idea" => Icons::INTELLIJ, // 
".ideavimrc" => Icons::VIM, // 
".inputrc" => Icons::CONFIG, // 󱁻
".kshrc" => Icons::SHELL, // 󱆃
Expand Down Expand Up @@ -299,7 +301,6 @@ const FILENAME_ICONS: Map<&'static str, char> = phf_map! {
".pylintrc" => Icons::CONFIG, // 󱁻
".python_history" => Icons::LANG_PYTHON, // 
".rustfmt.toml" => Icons::LANG_RUST, // 
".rvm" => Icons::LANG_RUBY, // 
".rvmrc" => Icons::LANG_RUBY, // 
".SRCINFO" => '\u{f303}', // 
".stowrc" => '\u{eef1}', // 
Expand All @@ -317,7 +318,6 @@ const FILENAME_ICONS: Map<&'static str, char> = phf_map! {
".zshenv" => Icons::SHELL, // 󱆃
".zshrc" => Icons::SHELL, // 󱆃
".zsh_history" => Icons::SHELL, // 󱆃
".zsh_sessions" => Icons::SHELL, // 󱆃
"._DS_Store" => Icons::OS_APPLE, // 
"_gvimrc" => Icons::VIM, // 
"_vimrc" => Icons::VIM, // 
Expand Down Expand Up @@ -1490,6 +1490,20 @@ mod test {
assert_eq!(icon_for_name_ext("Layout.astro", Some("astro")), '\u{e6b3}');
}

#[test]
fn test_dot_directory_icons_upstream_1940() {
// Upstream #1940 / #1943: .atom, .idea, .rvm, .zsh_sessions are directories
assert_eq!(DIRECTORY_ICONS.get(".atom"), Some(&'\u{e764}'));
assert_eq!(DIRECTORY_ICONS.get(".idea"), Some(&Icons::INTELLIJ));
assert_eq!(DIRECTORY_ICONS.get(".rvm"), Some(&Icons::LANG_RUBY));
assert_eq!(DIRECTORY_ICONS.get(".zsh_sessions"), Some(&Icons::SHELL));

assert_eq!(FILENAME_ICONS.get(".atom"), None);
assert_eq!(FILENAME_ICONS.get(".idea"), None);
assert_eq!(FILENAME_ICONS.get(".rvm"), None);
assert_eq!(FILENAME_ICONS.get(".zsh_sessions"), None);
}

#[test]
fn test_icon_for_name_ext_fallback() {
assert_eq!(
Expand Down
32 changes: 32 additions & 0 deletions tests/icons_theme/dot_directory_icons.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// SPDX-FileCopyrightText: 2026 fxrdhan
// SPDX-License-Identifier: EUPL-1.2

//! Directory icons for dot-directories (upstream #1940 / #1943: `.atom`,
//! `.idea`, `.rvm`, `.zsh_sessions`), which were previously placed in
//! `FILENAME_ICONS` where directories never reached them.
//! This verifies each reaches its entry in lines and tree listings.

use crate::common::{TempTestDir, lez_in, success_stdout};

#[test]
fn dot_directory_names_get_their_icons() {
let dir = TempTestDir::new("dot_directory_icons");
dir.create_dir(".atom");
dir.create_dir(".idea");
dir.create_dir(".rvm");
dir.create_dir(".zsh_sessions");

let lez = |args: &[&str]| success_stdout(lez_in(dir.path()).arg("--icons=always").args(args));
assert_eq!(
lez(&["-1a"]),
"\u{e764} .atom\n\u{e7b5} .idea\n\u{e739} .rvm\n\u{f1183} .zsh_sessions\n"
);
assert_eq!(
lez(&["-Ta"]),
"\u{e5ff} .\n\
├── \u{e764} .atom\n\
├── \u{e7b5} .idea\n\
├── \u{e739} .rvm\n\
└── \u{f1183} .zsh_sessions\n"
);
}
2 changes: 2 additions & 0 deletions tests/icons_theme_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ mod data_files;
mod default_overrides;
#[path = "icons_theme/dev_eclass_astro.rs"]
mod dev_eclass_astro;
#[path = "icons_theme/dot_directory_icons.rs"]
mod dot_directory_icons;
#[path = "icons_theme/empty_dirs.rs"]
mod empty_dirs;
#[path = "icons_theme/glob_precedence.rs"]
Expand Down
Loading