`ScreenDiff` across different sizes prints rows unclipped, so the columns and the `^` markers misalign
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 82/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- rust
- Domain
- testing-qa
Research direction
Read screen/diff.rs around lines 87–92 and 296–307, then inspect the existing tests in diff.rs. The issue identifies row_text, rect_text(..cols, row..=row), and the CLI colored rendering at termlens-cli/src/main.rs:499 as relevant entry points. Done means diffs across different screen sizes keep the column separators aligned in plain and colored output, with a regression test in diff.rs.
Written by the indexing model from the issue text.
Description
What happens.
termlens inspect --size 30x3 sh -c 'printf "hello world and more text"' > big.snap
termlens inspect --size 10x3 sh -c 'printf jello' > small.snap
termlens diff big.snap small.snap
compared over the 10x3 overlap; the rest is clipped
0 │hello world and more text│jello
│^ ^^^^│^ ^^^^
The header says the rest is clipped, but the before row is printed whole. So the │ separators do not line up with the marker line's, and the after-side carets sit under the wrong cells. Reproduced through the library too: a 12x2 screen diffed against a 6x2 one gives │hello world!│hellO over │ ^ │ ^. The rows field's doc ("The rows of the taller screen") does not say this either.
Cause. screen/diff.rs:87-92 stores each screen's full row_text. pad (:296-307) pads to the overlap width but never truncates.
Related, from the CLI's coloured mode. The before side is laid out on before.cols. Changed trailing blanks on the after side are wrapped in SGR, so the trim_end at termlens-cli/src/main.rs:499 leaves \e[32m \e[0m runs.
Fix. Store each row clipped to the overlap columns (rect_text(..cols, row..=row)), and render the coloured form from the same clipped text.
Done when a diff across sizes keeps every │ in one column, plain and coloured, with a test in diff.rs.
- Dominant language
- Rust
- Stars
- 28
- Forks
- 24
- Avg merge
- 11h 23m
- Merged PRs (30d)
- 42
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from vyncint/termlens
-
documentation good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
documentation good first issue
Difficulty 1/5 Under an hour Newbie friendliness 95/100
Maintainers usually reply within 1 day
-
Release notes show a broken link: `extract-changelog.sh` copies a reference but not its definitionOpenbug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
All issues in vyncint/termlens
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
libnativeapi/nativeapi#21 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
longbridge/nsh#804 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day