Suggest an idea for Knip
Prerequisites
Description
I’m raising this as a follow-up to #1494.
The change there improved the default symbols reporter by truncating file paths from the left instead of the right, which is definitely better. But for local terminal/editor workflows, the underlying issue still feels unresolved: file paths are still truncated automatically based on terminal width.
This is a problem because the default symbols reporter is the nicest human-readable output, but truncating file paths makes it harder to act on the results directly.
A common workflow in VS Code/Cursor is:
- run
knip in the integrated terminal
alt/option click the file:line:col location to jump straight to the issue
When the path is truncated, that workflow breaks or becomes unreliable, especially in smaller terminal panes.
Current behavior
The default symbols reporter truncates file paths to fit terminal width.
This is understandable for compact display, but it means diagnostic locations are no longer always fully available in the output.
Expected behaviour
I think one of these would be ideal:
- Add a config/CLI option to disable file path truncation in the
symbols reporter.
- Or, avoid truncating diagnostic file paths by default in the
symbols reporter.
- Or at minimum, preserve the full
file:line:col location while still allowing other columns to be truncated.
Why this matters
The default reporter is excellent for humans, but diagnostics are most useful when they are directly actionable.
For local development, I’d personally prefer long lines / soft wrapping over truncating file paths, because:
- terminals already handle wrapping
- editor-integrated terminals often support click-to-open
- full paths are more important than strict table width
Preference
My personal preference would be:
- default: do not truncate diagnostic file paths in
symbols
- fallback: if that’s not desirable as a default, please add a config or reporter option to disable truncation
Something along the lines of:
truncateFilePath: false
reporterOptions for symbols
- or a more general table/reporter truncation setting
Additional note
I’m aware other reporters exist, but the default symbols reporter is the most pleasant one to use interactively, which is why this feels worth improving there specifically.
I'm happy to make a PR if a decision is made on the best path forward for this 😁
Suggest an idea for Knip
Prerequisites
Description
I’m raising this as a follow-up to #1494.
The change there improved the default
symbolsreporter by truncating file paths from the left instead of the right, which is definitely better. But for local terminal/editor workflows, the underlying issue still feels unresolved: file paths are still truncated automatically based on terminal width.This is a problem because the default
symbolsreporter is the nicest human-readable output, but truncating file paths makes it harder to act on the results directly.A common workflow in VS Code/Cursor is:
knipin the integrated terminalalt/optionclick thefile:line:collocation to jump straight to the issueWhen the path is truncated, that workflow breaks or becomes unreliable, especially in smaller terminal panes.
Current behavior
The default
symbolsreporter truncates file paths to fit terminal width.This is understandable for compact display, but it means diagnostic locations are no longer always fully available in the output.
Expected behaviour
I think one of these would be ideal:
symbolsreporter.symbolsreporter.file:line:collocation while still allowing other columns to be truncated.Why this matters
The default reporter is excellent for humans, but diagnostics are most useful when they are directly actionable.
For local development, I’d personally prefer long lines / soft wrapping over truncating file paths, because:
Preference
My personal preference would be:
symbolsSomething along the lines of:
truncateFilePath: falsereporterOptionsforsymbolsAdditional note
I’m aware other reporters exist, but the default
symbolsreporter is the most pleasant one to use interactively, which is why this feels worth improving there specifically.I'm happy to make a PR if a decision is made on the best path forward for this 😁