eza-community / eza-community/eza
feat: truncate lines to terminal width when using -l and -1 switches
- Dominant language
- Rust
- Stars
- 23.3k
- Forks
- 523
- PR merge metrics
- No merged PRs in 30d
Description
Hello!
It would be nice to have (maybe as an option) the long lines truncated to the current terminal width, when using -l or -1 switches, so that any single line never overflows to the following.

Best of all, when the new hypotetical "--truncate" option is used, eza could manage the long paths in smart ways - example from my screenshot above:
the line
`Cookies -> C:\Users\raffaele.bianco\AppData\Local\Microsoft\Windows\INetCookies`
could be rendered as
`Cookies -> C:\Users\raffaele.bianco\AppData\Local\...\INetCookies`
or
`Cookies -> C:\Users\raffaele.bianco\...\INetCookies`
reducing a subset of the last path elements to a shorter "..." (accordingly to the current terminal width), but keeping the last folder for best readability.
Oh-my-posh can do something similar (if I remember correctly) - hoping that this is somewhat useful to know.
Contributor guide
Research direction
No files, tests, or entry points are named. Begin by tracing the -l and -1 switches and how terminal width is handled, then clarify whether --truncate and smart path shortening are required; done should mean long lines no longer overflow the terminal and the expected shortening behavior is specified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100