Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions src/components/TerminalView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { TerminalBookmarkGutter } from './TerminalBookmarks';
import { invoke, fireAndForget, Channel } from '../lib/ipc';
import { IPC } from '../../electron/ipc/channels';
import { getTerminalFontFamily } from '../lib/fonts';
import { TERMINAL_SCROLLBACK_LINES, base64ToUint8Array } from '../lib/terminalConstants';
import { TERMINAL_SCROLL_OPTIONS, base64ToUint8Array } from '../lib/terminalConstants';
import {
getTerminalSearchDecorations,
getTerminalTheme,
Expand Down Expand Up @@ -418,7 +418,7 @@ export function TerminalView(props: TerminalViewProps) {
fontFamily: getTerminalFontFamily(store.terminalFont),
theme: activeTerminalTheme(),
allowProposedApi: true,
scrollback: TERMINAL_SCROLLBACK_LINES,
...TERMINAL_SCROLL_OPTIONS,
disableStdin: taskPtyDetached(),
linkHandler: {
activate: openTerminalHttpLinkWithModifier,
Expand Down
8 changes: 7 additions & 1 deletion src/lib/terminalConstants.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
// Keep substantially more terminal history available for agent review/debugging
// without turning xterm into a memory landfill.
export const TERMINAL_SCROLLBACK_LINES = 10_000;
// xterm defaults scrollSensitivity to 1 line per wheel notch, which makes scrolling
// back through agent output painfully slow. Alt-scroll multiplies this again by
// xterm's fastScrollSensitivity default of 5, so we leave that one alone.
export const TERMINAL_SCROLL_OPTIONS = {
scrollback: 10_000,
scrollSensitivity: 2,
} as const;

// Pre-computed base64 lookup table — avoids atob() intermediate string allocation.
const B64_LOOKUP = new Uint8Array(128);
Expand Down
4 changes: 2 additions & 2 deletions src/remote/AgentDetail.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { onMount, onCleanup, createSignal, createEffect, untrack, Show, For } from 'solid-js';
import { Terminal } from '@xterm/xterm';
import { FitAddon } from '@xterm/addon-fit';
import { TERMINAL_SCROLLBACK_LINES, base64ToUint8Array } from '../lib/terminalConstants';
import { TERMINAL_SCROLL_OPTIONS, base64ToUint8Array } from '../lib/terminalConstants';
import { createTerminalHttpLinkHandler } from '../lib/terminalLinks';
import { fetchNotes, saveNotes } from './api';
import { agentStatusDisplay } from './attention';
Expand Down Expand Up @@ -209,7 +209,7 @@ export function AgentDetail(props: AgentDetailProps) {
fontSize: 10,
fontFamily: TERM_FONT_FAMILY,
theme: { background: '#0b0f14' },
scrollback: TERMINAL_SCROLLBACK_LINES,
...TERMINAL_SCROLL_OPTIONS,
cursorBlink: false,
disableStdin: true,
convertEol: false,
Expand Down
Loading