`unsupported()` lists a window title containing `;`, and misses `CSI 4;20 h`

Open Beginner friendly
#625 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
86/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
rust
Domain
testing

Research direction

Read emu/unhandled.rs, especially the OSC exemption around line 248 and mode handling around line 190, then inspect tests/unsupported.rs. Add tests for both provided repros and check that OSC 0/2 titles are exempt while h/l sequences are handled only when every parameter is supported. Done means both repros return the expected unsupported results and the tests pass.

Written by the indexing model from the issue text.

Description

bug good first issue

What happens. unsupported() is wrong in both directions for two common shapes:

  1. A title with a semicolon is listed although it is honoured. After printf '\033]2;make; test\007ok', title() is "make; test", yet unsupported() is ["^[]2;make; test"].
  2. LNM is dropped silently. printf 'x\033[4;20h' gives unsupported() == []. The same modes in the other order, \033[20;4h, give ["^[[20;4h"].

Cause.

  1. vt100 only matches the exact two-parameter [0|1|2, s] OSC forms. termlens's tracker sets the title itself, but the exemption list in emu/unhandled.rs:248 follows vt100.
  2. emu/unhandled.rs:190 checks first == Some(4) and treats the whole sequence as handled.

Why it matters. assert!(screen.unsupported().is_empty()) is the documented way to prove a screen is trustworthy. Case 1 fails it for any program whose title contains a semicolon, such as a shell running a command line. Case 2 lets a dropped mode through.

Fix.

  1. Exempt OSC 0/2 always, since the tracker owns the title.
  2. For h/l, count the sequence as handled only when every parameter is one the emulator honours.

Done when both repros give the right answer, with tests in tests/unsupported.rs.

Dominant language
Rust
Stars
28
Forks
24
Avg merge
11h 23m
Merged PRs (30d)
42

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from vyncint/termlens

All issues in vyncint/termlens

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.