Pin input prompt to bottom of viewport during scroll (Windows Terminal)

Resolved 💬 2 comments Opened Jan 28, 2026 by BlacksBart Closed Jan 28, 2026

Problem

When running Claude Code CLI in Windows Terminal (started from PowerShell 7.6.0), the input prompt scrolls out of view when the chat buffer exceeds the terminal's visible rows.

Current behavior:

  1. User receives a long response that exceeds terminal height
  2. User scrolls up to reference details in the response
  3. The input prompt disappears from view
  4. User must mentally retain details, scroll back down, type prompt, and repeat

This creates significant friction when crafting prompts that reference specific details from earlier in the conversation (e.g., line numbers, variable names, error messages).

Expected Behavior

The input prompt should remain pinned to the bottom of the visible viewport while the chat content scrolls independently above it—similar to how vim, nano, less, and other TUI applications handle this.

Proposed Solution

Use ANSI scroll regions to create a fixed input area:

// Set scroll region excluding bottom N lines for input
const rows = process.stdout.rows || 24;
process.stdout.write(`\x1b[1;${rows - 3}r`);

// Content scrolls within lines 1 to (rows-3)
// Input prompt renders in fixed bottom 3 lines

This approach:

  • Works in Windows Terminal, iTerm2, and most modern terminal emulators
  • Is the standard pattern used by terminal-based editors
  • Requires minimal changes to the Ink renderer

Environment

  • OS: Windows 11
  • Terminal: Windows Terminal
  • Shell: PowerShell 7.6.0
  • Claude Code: Latest

Workarounds Attempted

  1. Windows Terminal split panes (Ctrl+Shift+D) - functional but clunky
  2. PowerShell wrapper setting scroll regions - overridden by Ink's terminal state management
  3. tmux via WSL - works but adds complexity

Additional Context

This is a common UX pattern request for CLI chat interfaces. The VS Code terminal inline chat solves this elegantly by using a fixed-position widget. For CLI, ANSI scroll regions are the terminal-native equivalent.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗