mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-11-14 10:39:32 +01:00
fix(terminal): log xterm's mouse encoding with each scroll routing decision
Merge-time fix for #664 (optional item): _logScrollRouting now prints mouseEncoding (xterm's coreMouseService.activeEncoding, 'unknown' when the private cannot be read) and counts it in the per-session signature, since an app switching encodings changes where a touch drag goes. Adds a unit test for that line and one asserting SGR_PIXELS fails closed. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
d38291b143
commit
76c17e5c4e
2 files changed
+29
-3
No files matched your search
@@ -876,6 +876,20 @@ describe('scroll routing diagnostic (issue #205 round 2)', () => {
|
||||
app._logScrollRouting('page-keys');
|
||||
expect(logs[0]).toContain('cliVersion=unknown');
|
||||
});
|
||||
|
||||
it("reports xterm's mouse encoding, the input touch forwarding to native tracking reads", () => {
|
||||
const { app, logs } = hollowApp({ mode: 'shell' });
|
||||
app._logScrollRouting('local-scrollback'); // no readable xterm private
|
||||
expect(logs[0]).toContain('mouseEncoding=unknown');
|
||||
|
||||
// An app switching to SGR changes what touch does, so it prints again.
|
||||
app.terminal.modes.mouseTrackingMode = 'any';
|
||||
app.terminal._core = { coreMouseService: { activeEncoding: 'SGR' } };
|
||||
app._logScrollRouting('local-scrollback');
|
||||
expect(logs).toHaveLength(2);
|
||||
expect(logs[1]).toContain('mouseTracking=any');
|
||||
expect(logs[1]).toContain('mouseEncoding=SGR');
|
||||
});
|
||||
});
|
||||
|
||||
describe('touch scrolling when xterm owns native mouse tracking', () => {
|
||||
@@ -898,6 +912,13 @@ describe('touch scrolling when xterm owns native mouse tracking', () => {
|
||||
expect(app._shouldForwardTouchToApp()).toBe(false);
|
||||
});
|
||||
|
||||
it('does not send cell-based SGR reports to an app that asked for SGR pixel coordinates', () => {
|
||||
const { app } = hollowApp({ mode: 'shell' });
|
||||
app.terminal.modes.mouseTrackingMode = 'any';
|
||||
app.terminal._core = { coreMouseService: { activeEncoding: 'SGR_PIXELS' } };
|
||||
expect(app._shouldForwardTouchToApp()).toBe(false);
|
||||
});
|
||||
|
||||
it('keeps the explicit local-history preference for touch', () => {
|
||||
const { app } = hollowApp({ mode: 'shell' });
|
||||
app.terminal.modes.mouseTrackingMode = 'any';
|
||||
|
||||
Reference in new issue
Block a user