Skip to content
Closed
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: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ All notable changes to AngKorGit are documented here. The format follows

## [Unreleased]

### Fixed
- Opening the terminal now focuses its input immediately, so typing works without
clicking inside it first.

## [0.21.1] — 2026-10-04

A patch for the horizontal scrollbar that 0.21.0 introduced. On macOS it halved every
Expand Down
7 changes: 6 additions & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2334,7 +2334,12 @@ features/
│ persistent: a module-level Map keyed by repo path holds
│ each xterm + its DOM container, unmount only detaches
│ (container.remove()), remount re-appends — scrollback and
│ running processes survive repo switches. Killed only via
│ running processes survive repo switches. Focus after BOTH
│ fresh-session setup and re-attachment, so opening the panel
│ accepts typing immediately. A reused-only focus call was
│ masked by dev StrictMode's second effect run; verify the
│ focus e2e against a production build served by Vite preview
│ as well as dev mode. Killed only via
│ killTerminalSession(path) (RepoTabs close) or shell exit
│ (exited flag → fresh session on next mount)
├── settings/ ← store (theme, accent, zoom, reduceMotion, interface/code/terminal
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/features/terminal/TerminalPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,8 @@ export function TerminalPanel() {
} else {
session.terminal.options.theme = terminalThemeFromTokens();
session.fit.fit();
session.terminal.focus();
}
session.terminal.focus();

const attached = session;
const observer = new ResizeObserver(() => attached.fit.fit());
Expand Down
11 changes: 10 additions & 1 deletion tests/e2e/smoke.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1617,13 +1617,22 @@ test('the remotes section offers Add remote and opens the add dialog', async ({
await expect(dialog).toBeHidden();
});

test('the terminal answers right-click with copy, paste, select all and clear', async ({ page }) => {
test('the terminal focuses on open and reopen and offers its right-click actions', async ({ page }) => {
await page.goto('/');
await page.getByText('angkorgit', { exact: true }).first().click();
await expect(page.getByPlaceholder('Search commits…')).toBeVisible({ timeout: 10_000 });
await page.getByRole('button', { name: 'Toggle terminal' }).click();
const host = page.locator('.terminal-host');
await expect(host).toBeVisible();
await expect(host.locator('.xterm-helper-textarea')).toBeFocused();
await page.keyboard.type('first-open');
await expect(host.locator('.xterm-rows')).toContainText('first-open');
await page.getByRole('button', { name: 'Close terminal' }).click();
await expect(host).toBeHidden();
await page.getByRole('button', { name: 'Toggle terminal' }).click();
await expect(host.locator('.xterm-helper-textarea')).toBeFocused();
await page.keyboard.type('-reopened');
await expect(host.locator('.xterm-rows')).toContainText('first-open-reopened');
await host.click({ button: 'right' });
const menu = page.getByRole('menu');
await expect(menu.getByRole('menuitem', { name: 'Copy' })).toBeDisabled();
Expand Down
Loading