mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-09-30 12:39:42 +02:00
Mode-agnostic terminal foundation extracted from the downstream branch: - formatPaneSnapshot: SGR/grapheme-aware tmux pane capture + active-pane resolution, with OSC/CSI redraw suppression and the buffer-load owner-token race fix on the terminal fetch path - socket-correct tmux lifecycle: dedicated -L socket and /tmp launch cwd in createSession (restores the FUSE/getcwd hardening from #110), and a socket-aware re-attach window-size query (avoids the 120x40 flicker) - inline-rename: commit/cancel state handling clears _activeRename and skips the API call on cancel - selectSession: restored detached-window raise short-circuit The codex-specific xterm snapshot/replay, the vendored serialize addon, and the synchronous live pane-capture on the request path are intentionally excluded: they depend on a 'codex' SessionMode that doesn't exist on master and are deferred to COD-34 (which introduces that mode). The capture primitives remain exported for COD-34 to build on. Co-Authored-By: Saqeb Akhter <saqeb.akhter@gmail.com>
20 lines
763 B
TypeScript
20 lines
763 B
TypeScript
import { readFileSync } from 'node:fs';
|
|
import { resolve } from 'node:path';
|
|
import { describe, expect, it } from 'vitest';
|
|
|
|
function cssRuleBody(css: string, selector: string): string {
|
|
const escaped = selector.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
const match = css.match(new RegExp(`${escaped}\\s*\\{([^}]*)\\}`));
|
|
return match?.[1] ?? '';
|
|
}
|
|
|
|
describe('terminal layout CSS', () => {
|
|
it('pins the xterm root to the terminal container width while scrollback moves', () => {
|
|
const css = readFileSync(resolve(import.meta.dirname, '../src/web/public/styles.css'), 'utf8');
|
|
const xtermRule = cssRuleBody(css, '.terminal-container .xterm');
|
|
|
|
expect(xtermRule).toContain('width: 100%');
|
|
expect(xtermRule).toContain('min-width: 0');
|
|
});
|
|
});
|