runMosaicMain

fun runMosaicMain(alternateScreen: Boolean = false, mouse: Boolean = alternateScreen, content: @Composable () -> Unit)

Run content until it completes, for use in main.

Parameters

alternateScreen

When true, render full screen on the terminal's alternate screen, which is restored once content completes. The content is then measured to exactly the size of the terminal. Otherwise, render below the previous output, as wide as the terminal and at most as tall as it.

mouse

Whether to report mouse events to modifiers like onPointerEvent and onClick, and scroll with the wheel. This takes over the mouse, so the terminal's own text selection and scrolling only work with a modifier key held, like Shift or Option, depending on the terminal. Instead, dragging where no pointer handler takes the press selects text, double clicks select words and triple clicks rows, and the selection is copied to the clipboard with OSC 52 once released. It is enabled on the alternate screen by default.