Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/ui/SessionsApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -734,10 +734,19 @@ export function SessionsApp(props: SessionsAppProps): React.ReactElement {
</Box>
)

// Every full-height frame below may only paint once the terminal is ON the
// alternate buffer, and the hop is an effect: a frame committed before it
// settles lands on the PRIMARY buffer instead, shoving the shell's history
// (and any earlier transcript) a screenful up into scrollback — exactly the
// rows the chat's scrollback view promises to leave in place. So the frames
// in the hop gap render nothing, same as the chat's own gap below.
const fullFrameHopGap = !altScreenOn

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The hop gap is missing on the other primary→alt transition: ctrl+r's transcript browser still paints a full-height frame on the primary buffer. ConnectApp calls useAltScreen(windowed) at src/ui/ConnectApp.tsx:315 and throws the settled flag away, so the frame where windowed flips true commits with minHeight={rows - bottomSlack} (src/ui/ConnectApp.tsx:1526) and the <Static> transcript withheld — before the 1049h write.

In a chat whose transcript reaches the bottom of the terminal, pressing ctrl+r paints a screenful-tall frame at the cursor, scrolling the flushed transcript rows up; 1049h then saves the already-damaged primary buffer, so esc restores the shifted history. Same failure this PR fixes for the picker, reached by a different key.


// The picker, open, IS the screen: it took over the alternate buffer, so it
// renders alone (header + list) and the chat is left untouched on the primary
// buffer, waiting behind it.
if (navOpen) {
if (fullFrameHopGap) return <Box />
return (
<Box flexDirection="column" height={height} padding={APP_INSET}>
{header}
Expand All @@ -756,6 +765,7 @@ export function SessionsApp(props: SessionsAppProps): React.ReactElement {

// The remaining screens (the new-session composer, a chat still loading) do
// own their frame, so they keep the inset and the header.
if (fullFrameHopGap) return <Box />
return (
<Box flexDirection="column" minHeight={height} padding={APP_INSET}>
{header}
Expand Down