Skip to content

feat: path input improvements, Ctrl+D delete, scrollback fix, copyClaudeDir#48

Open
google-q-dot wants to merge 1 commit into
Frayo44:mainfrom
google-q-dot:feat/path-input-improvements
Open

feat: path input improvements, Ctrl+D delete, scrollback fix, copyClaudeDir#48
google-q-dot wants to merge 1 commit into
Frayo44:mainfrom
google-q-dot:feat/path-input-improvements

Conversation

@google-q-dot
Copy link
Copy Markdown

Summary

Three sets of improvements to the new session dialog and session management, cherry-picked from open PRs #26 and #42, plus new path input features:

Path Input Improvements (new)

  • Ctrl+V paste support — Async clipboard reader (src/core/clipboard.ts) for terminals without bracketed paste (WSL/Windows Terminal); also added usePaste hook to InputAutocomplete to ensure suggestions update after bracketed paste
  • Filesystem-aware path autocompleteresolvePathCompletion() in src/core/filesystem.ts shows matching subdirectories as you type a path, merged with history suggestions via pathSuggestions createMemo
  • Ctrl+B directory browser — New DialogDirectoryBrowser component to navigate filesystem and find git repos; git repos marked with ★; once selected, worktree checkbox auto-appears via existing reactive isGitRepo() effect

From PR #42: Ctrl+D delete session + scrollback fix

  • Ctrl+D in tmux — Signal file pattern (/tmp/agent-view-delete-session) to delete current session from within attached tmux; status bar hint added
  • Scrollback fix — All \x1b[2J\x1b[H\x1b[2J\x1b[3J\x1b[H across tmux.ts, ssh.ts, updater.ts (9 occurrences) to clear scrollback buffer and prevent session switching artifacts
  • refresh-client after switchswitch-client -n/-p now followed by refresh-client to force redraw

From PR #26: copyClaudeDir + footer hints

  • copyClaudeDir — New copyClaudeDir() in src/core/git.ts copies .claude directory to new worktrees; controlled by copyClaudeDir config field (off by default)
  • Settings dialog — New "Copy .claude to worktree" toggle (Yes/No) in settings (c keybind)
  • Dynamic footer — When path/branch field is focused, footer shows "↓↑ browse | Tab/→ select | Ctrl+B dir | Enter create"

Test plan

  • Open new session dialog, focus path field → Ctrl+V should paste clipboard content
  • Type a path prefix (e.g. /home/) → autocomplete shows subdirectories
  • Press Ctrl+B → directory browser opens; navigate to a git repo → worktree checkbox appears
  • Attach a session, press Ctrl+D → detach and show delete confirmation
  • Switch between sessions (Ctrl+]/) → no scrollback artifacts from previous session
  • Settings: toggle "Copy .claude to worktree" to Yes → create worktree session → verify .claude copied
  • Settings: toggle back to No → verify .claude not copied
  • Footer hint: verify dynamic text changes when focusing path/branch fields
  • bun run build + bun test pass (145 tests, 0 fail)

🤖 Generated with Claude Code

…udeDir

- Add Ctrl+V paste support via clipboard utility (src/core/clipboard.ts)
- Add filesystem-aware path autocomplete showing subdirectories
  (src/core/filesystem.ts, InputAutocomplete usePaste hook)
- Add Ctrl+B directory browser for navigating to git repos
  (src/tui/component/dialog-directory-browser.tsx)
- Add Ctrl+D delete session from within tmux (signal file pattern)
- Fix scrollback buffer not being cleared on session switch (\x1b[3J)
- Add copyClaudeDir utility to copy .claude config to new worktrees
- Add "Copy .claude to worktree" setting in settings dialog
- Add dynamic footer hints for path/branch autocomplete fields

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@Snailflyer
Copy link
Copy Markdown

The Ctrl+V, Ctrl+D, scrollback, and session-switch changes all touch the same user-visible risk: the UI can look attached while the live tmux target is different or gone.

One cross-flow test I would add:

  • attach to session A
  • switch away and back
  • force redraw / scroll-to-bottom
  • send a tiny input
  • assert the same tmux session/pane consumed it and the output cursor advanced

For Ctrl+D, I would also keep delete confirmation separate from tmux/session teardown: delete_requested, tmux_session_killed, detached_only, stale_view, or wrong_session_focused.

That is the same boundary I use in Faryo: a phone/browser surface is trustworthy only when the original live tmux-backed session consumes the action, not when the UI state refreshes cleanly. Reference proof shape: https://github.com/Snailflyer/faryo/releases/download/v1.0.7/faryo-public-redacted-same-session-handoff-walkthrough-20260528-0120.gif

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants