-
-
Notifications
You must be signed in to change notification settings - Fork 219
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
Bug: output wraps in terminal (with --icons) #103
Comments
I'll look at this more tomorrow, what |
@cafkafk ive compiled eza from source (see got commit in version info, HEAD as of issue creation) |
I'm gonna try to get #83 done first, hopefully it will magically solve this. |
I think the root cause is here in 'src/output/grid.rs`, where we give the contents as the contents, but the file name as the width, leading to a mismatch with icons enabled. According to the comment, escapes stop us from using the content's width, so perhaps a workaround would be to just add one if grid.add(tg::Cell {
contents: contents.strings().to_string(),
// with hyperlink escape sequences,
// the actual *contents.width() is larger than actually needed, so we take only the filename
width: filename.bare_width(),
}); |
Back in exa v0.10.1, the code looked like this: grid.add(tg::Cell {
contents: filename.strings().to_string(),
width: *filename.width(),
});
} |
Actually, exa's HEAD still uses |
Then https://github.com/cafkafk/eza/pull/17/files#diff-0507c61e0f30892ff1a00883c4669b4a13c41e9377ae9bdf8d3818f38506eb63 is the probable culprit I suppose |
The blame shows this change being in 8196d52. I'm gonna try before this commit to see if I can reproduce the issue |
Checking out before doesn't quite work because the grid was still completely messed up before that, but reverting |
It would likely break |
very much so. > cargo run --release -- --hyperlink
build.rs Cargo.toml cliff.toml completions file flake.nix Justfile man rust-toolchain.toml snap target Vagrantfile
Cargo.lock CHANGELOG.md CODE_OF_CONDUCT.md devtools flake.lock heloo?h\\ LICENCE README.md screenshots.png src treefmt.nix xtests After: > cargo run --release -- --hyperlink
build.rs file rust-toolchain.toml
Cargo.lock flake.lock screenshots.png
Cargo.toml flake.nix snap
CHANGELOG.md heloo?h\\ src
cliff.toml Justfile target
CODE_OF_CONDUCT.md LICENCE treefmt.nix
completions man Vagrantfile
devtools README.md xtests |
I think the options here would be:
|
This might be the preferred solution, but I think it would require a bit of a refactor.
I've got something a bit like this in mind (reacting to hyperlink being present in filename.options as well as icons being present there). Perhaps this is the short term solution to go for first. I've got a sketch for a solution for this, I'll create a PR for it in a moment. |
Tracking-issue: #103 Co-authored-by: aarondill <[email protected]> Signed-off-by: Christina Sørensen <[email protected]>
Tracking-issue: eza-community#103 Co-authored-by: aarondill <[email protected]> Signed-off-by: Christina Sørensen <[email protected]>
Here's a reproduction:
Note that the line splitting is put in place by me. It is technically outputting a single line, but because it reaches the end, it wraps. When copying the output, I had to manually insert newlines to mimic the output seen on my terminal.
Versioning
Git commit: 5f29705Does this have something to do with #66 / #83?
Note: the same procedure with
exa v0.10.1 [-git]
:The text was updated successfully, but these errors were encountered: