diff --git a/packages/tui/src/overlay-layout.ts b/packages/tui/src/overlay-layout.ts index 0110f0f57..88cf527e7 100644 --- a/packages/tui/src/overlay-layout.ts +++ b/packages/tui/src/overlay-layout.ts @@ -12,7 +12,7 @@ import type { } from "./overlay-types.js"; import { tryRender } from "./render-guard.js"; import { isImageLine } from "./terminal-image.js"; -import { CURSOR_MARKER } from "./tui.js"; +import { CURSOR_MARKER } from "./overlay-types.js"; import { applyBackgroundToLine, extractSegments, diff --git a/packages/tui/src/overlay-types.ts b/packages/tui/src/overlay-types.ts index bc9ac00f8..0f45f3e8b 100644 --- a/packages/tui/src/overlay-types.ts +++ b/packages/tui/src/overlay-types.ts @@ -1,7 +1,19 @@ /** * Overlay sizing, anchoring, and handle types for layered TUI content. + * + * Also hosts CURSOR_MARKER (moved here from ./tui.ts to break the + * tui ↔ overlay-layout circular import — both files already import + * this module, so it's the natural shared landing zone). */ +/** + * Cursor position marker — APC (Application Program Command) sequence. + * This is a zero-width escape sequence that terminals ignore. + * Components emit this at the cursor position when focused. + * TUI finds and strips this marker, then positions the hardware cursor there. + */ +export const CURSOR_MARKER = "\x1b_sf:c\x07"; + /** Margin configuration for overlays */ export interface OverlayMargin { top?: number; diff --git a/packages/tui/src/tui.ts b/packages/tui/src/tui.ts index 1e1511262..8617392a4 100644 --- a/packages/tui/src/tui.ts +++ b/packages/tui/src/tui.ts @@ -83,13 +83,11 @@ export function isFocusable( return component !== null && "focused" in component; } -/** - * Cursor position marker - APC (Application Program Command) sequence. - * This is a zero-width escape sequence that terminals ignore. - * Components emit this at the cursor position when focused. - * TUI finds and strips this marker, then positions the hardware cursor there. - */ -export const CURSOR_MARKER = "\x1b_sf:c\x07"; +// CURSOR_MARKER moved to ./overlay-types.ts to break the +// tui ↔ overlay-layout circular import. Re-exported here so +// existing call sites that import { CURSOR_MARKER } from "./tui.js" +// keep working. +export { CURSOR_MARKER } from "./overlay-types.js"; export type { OverlayAnchor,