Repository navigation
Color file listings, and show icons with eza - #11
Merged
Merged
Conversation
ls now shows files in color: folders blue, links cyan, executables green, and every other file in the color its icon has in the file tree. Panes get CLICOLOR, LSCOLORS and LS_COLORS (for macOS's ls, and for eza, GNU ls and zsh's completion), each unless it's already set, and the user's startup files still win. The colors are named as terminal colors, so a listing follows the theme; only the accent is given as 24-bit color. FileType now carries its color in CodecCore, so the file tree and FileListingColors share one table. Settings › Shell › Use eza for ls makes ls run eza with icons and folders first, through an alias the zsh integration sets at the first prompt. An ls alias or function of the user's own is left alone, unless all it does is turn on color. When eza isn't installed, Settings offers to install it: with Homebrew, brew install eza runs in a new tab, where it can be watched and answered, and the setting turns on; without, it links to eza's instructions. The icons show in any font. Codec now carries Nerd Fonts' symbols (MIT, in Resources/Fonts, bundled by build-app.sh), and its glyph font cascades to them: SwiftTerm takes a single fallback font, and CoreText's cascade list lets that one font reach the icons too. Only private-use characters and the power symbols the font has are claimed, placed as icons, with Powerline's separators stretched to fill their cell, so ordinary symbols are still the system's and a patched Nerd Font keeps its own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The tour gains a shot of ls through eza, with icons and a long listing with git's status, for the Listing files section of the command line docs. It clears NO_COLOR, which swift test sets and the panes would pass on to eza; Codec opened from the Finder has none. The open-file shot lists ten files now, as the two new ones in CodecCore pushed FileTree.swift past the eighth. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
File listings in Codec now look like a modern Linux terminal's:
lscolors files by type in the theme's palette, and, with eza, shows a Nerd Font icon by each name, in any font.Colors
lscolors folders, links and executables, and every other file in the color its icon has in the file tree (Swift red, Markdown blue, lockfiles gray). Panes getCLICOLOR,LSCOLORS(macOS'sls) andLS_COLORS(eza, GNUls, zsh's completion menu), each only if it isn't already set, and the user's.zshrcstill wins. The colors are named as terminal colors, so a listing follows the theme; only the accent is 24-bit.FileType.colormoved into CodecCore, so the file tree andFileListingColorsshare one table. On by default: Settings › Shell › Color files by type.eza, with icons
Settings › Shell › Use eza for ls (off by default) makes
lsan alias foreza --icons=auto --group-directories-first, set by the zsh integration at the first prompt. Anlsalias or function of the user's own is kept, unless all it does is turn on color (ls -G).When eza isn't installed, the same section shows Install with Homebrew, which runs
brew install ezain a new tab (where it can be watched and answered) and turns the setting on. Without Homebrew, it links to eza's install instructions.Icons in any font
Codec now bundles Nerd Fonts' symbols (
Resources/Fonts, MIT, 2.4 MB;build-app.shcopies it into the app). SwiftTerm takes one fallback font, so Codec's glyph font gets a CoreText cascade list that reaches the symbols. Codec claims only the private-use characters and power symbols that font has: they're placed as icons, and Powerline's separators stretch to fill their cell. Ordinary symbols (♥ ⚡ ❯) stay with the system, and a patched Nerd Font keeps its own. Starship, lsd and Neovim file trees benefit too.Screenshots
All of
docs/imageswas retaken withmake screenshots. The tour has a newlistingshot (above), used in the command line docs. It now clearsNO_COLOR, whichswift testsets and eza honors. Plainlsin the theme grid now shows folders in color:Testing
swift build -j 2 --build-tests,swift test -j 2 --skip-build: all 518 pass. New tests cover theLS_COLORStable, the eza alias in a real zsh (installed, replacing a color-only alias, keeping a user's own, no eza, setting off), the icon fallback down to the run's font, the pane's environment, finding eza and Homebrew, and running a command in a new tab.ARCHS="arm64 x86_64" scripts/build-app.sh release: builds, with the font inContents/Resources/Fonts.🤖 Generated with Claude Code