Page MenuHomeFreeBSD

Fix vt(4)'s response to Device Status Report escape sequences
Needs ReviewPublic

Authored by guest-svmhdvn on Aug 7 2017, 8:38 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 14, 9:17 AM
Unknown Object (File)
Oct 22 2025, 9:31 PM
Unknown Object (File)
Oct 6 2025, 8:44 AM
Unknown Object (File)
Oct 6 2025, 8:43 AM
Unknown Object (File)
Oct 3 2025, 10:11 PM
Unknown Object (File)
Sep 30 2025, 12:04 AM
Unknown Object (File)
Sep 29 2025, 8:26 PM
Unknown Object (File)
Sep 29 2025, 11:16 AM
Subscribers

Details

Reviewers
emaste
ray
Summary

Fixes bug 220507.

Libteken would correctly compute the cursor position for a CPR escape sequence ("[6n"), but wouldn't write it back to the TTY device.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

The problem with this change is that I'm not 100% sure this won't cause an infinite amount of recursion in the TTY layer. Basically, this is what's happening:

Write to TTY -> Write to struct terminal -> Processed by libteken -> Result pushed back into the TTY.

But what if the TTY has echoing enabled? The response will be pushed through the terminal layer once more.

For this to work, we'll need to introduce another version of rint() that is guaranteed to ignore echoing. Alternatively, we should add a callout/taskqueue/... to push the response back into the TTY layer asynchronously.

  • Add a check for the maximum history size. This maximum is set to the same value as the maximum in syscons(4).
  • Fix the error string on a negative number argument

Accidentally updated wrong review, reverting back to previous diff