fix: Enable clipboard copy/paste in dashboard terminals#43
Conversation
Fixes GitHub issue #42. Root cause: ttyd terminals embedded in iframes lacked clipboard permissions. Changes: 1. Add allow="clipboard-read; clipboard-write" to all iframe elements in the dashboard templates to grant clipboard access via Permissions Policy 2. Add rightClickSelectsWord=true option to ttyd for better UX - this is standard behavior in macOS applications Files changed: - codev/templates/dashboard-split.html (iframe permissions) - codev-skeleton/templates/dashboard-split.html (iframe permissions) - agent-farm/src/commands/start.ts (ttyd option) - agent-farm/src/commands/util.ts (ttyd option) - agent-farm/src/servers/dashboard-server.ts (ttyd option) Resolves: #42
3-Way Review Synthesis (Claude + Codex + Gemini)Verdict: REQUEST_CHANGES (Minor)The fix is well-reasoned and correctly identifies the root cause (Permissions Policy blocking clipboard in iframes). However, the implementation is incomplete: Required Changes1. Missing clipboard permissions in non-split dashboard 2. Missing
Only Recommended TestsAdd basic tests to prevent regression: test('dashboard iframe includes clipboard permissions', () => {
const html = fs.readFileSync('codev/templates/dashboard-split.html', 'utf8');
expect(html).toMatch(/allow="clipboard-read; clipboard-write"/);
});
test('ttyd spawns with rightClickSelectsWord option', () => {
// Verify args include '-t', 'rightClickSelectsWord=true'
});What's Good
🤖 Synthesized from Claude Code, Codex, and Gemini reviews |
- Add clipboard permissions to non-split dashboard.html (codev + skeleton) - Add rightClickSelectsWord to spawn.ts builder/shell/worktree functions Addresses review feedback on PR #43
|
✅ Review feedback addressed in f6f87c0:
Ready for re-review. |
Review Feedback AddressedFixed the two issues identified in the 3-way review: 1. Non-split dashboard.html templates ✅Added
2. Missing rightClickSelectsWord in spawn.ts ✅Added
Verification
|
- Test that all dashboard HTML templates include clipboard permissions - Test that all ttyd spawn locations include rightClickSelectsWord - Prevents regression of issue #42 fix 9 new tests added, all passing (44 total)
Tests AddedAdded Dashboard clipboard permissions (4 tests):
ttyd rightClickSelectsWord (5 tests):
Results: All 44 tests pass (35 existing + 9 new) |
- Add clipboard permissions to non-split dashboard.html (codev + skeleton) - Add rightClickSelectsWord to spawn.ts builder/shell/worktree functions Addresses review feedback on PR #43
Summary
Fixes GitHub issue #42: Cannot cut and paste from terminals.
Root cause: ttyd terminals embedded in iframes lacked clipboard permissions. The browser's Permissions Policy blocks clipboard access for cross-origin iframes by default.
Solution:
allow="clipboard-read; clipboard-write"to all iframe elements in the dashboardrightClickSelectsWord=truettyd option for better UX (standard macOS behavior)Changes
Dashboard templates (
codev/templates/dashboard-split.html,codev-skeleton/templates/dashboard-split.html)ttyd configurations (
start.ts,util.ts,dashboard-server.ts)rightClickSelectsWord=truefor better selection UXHow to test
./codev/bin/agent-farm startTest plan
Resolves: #42