Skip to content

UX: Redraw screen on oclite boot — cursor at bottom #85

@randomm

Description

@randomm

Problem

When oclite boots, previous terminal output is visible above the header. The new session starts mid-screen with no visual separation. Users see stale output from prior runs mixed with the fresh oclite header.

Solution

Clear the screen on boot to give a clean start.

Boot sequence:

  1. \x1b[2J\x1b[H — Clear screen + cursor to home (top-left)
  2. Render header: oclite v0.1.0
  3. Show Setting up environment... with spinner while backend bootstraps
  4. Once bootstrap completes: clear the setup message, show Ready, render prompt with visible cursor

Important: Do NOT use alternate screen buffer (\x1b[?1049h) — this kills scrollback history. Use main buffer clear instead.

Research Findings (from exploration of Lazygit, Aider, Claude Code, htop)

  • Chat TUIs (Claude Code, Aider) never use alternate screen — users need scrollback
  • Editors/monitors (Lazygit, htop) do use alternate screen — but they don't need scrollback
  • Recommended: main buffer clear (\x1b[2J) for clean start while preserving future scrollback
  • Handle SIGWINCH for terminal resize

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions