inline-editor
Skill1.1k starsChanged 57 days agoMITView on GitHub
Inline text editing implementation within the file browser preview pane using tmux PTY backend, cursor movement, text manipulation, and editor state management. Covers entry/exit lifecycle, dimension calculations, confirmation dialogs, click-away detection, mouse forwarding, and app-level key routing. Use when working on inline editing features, text input components, or debugging editor rendering/input issues in the file browser plugin.
Trending
Less talk lately.about the whole repository
Who's talking about marcus/sidecar
- chenrui333/homebrew-tap“sidecar 1.16.0”GitHub · Oct 5, 2026 · 1 reactions
- chenrui333/homebrew-tap“sidecar 1.14.0”GitHub · Sep 23, 2026 · 1 reactions
- chenrui333/homebrew-tap“sidecar 1.13.0”GitHub · Sep 3, 2026 · 1 reactions
- chenrui333/homebrew-tap“sidecar 1.11.2”GitHub · Aug 31, 2026 · 1 reactions
- chenrui333/homebrew-tap“sidecar 1.9.0”GitHub · Aug 27, 2026 · 1 reactions
The biggest 5 of 48 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 48
Talked about on GitHub and Bluesky (48 times).
On GitHub · 47
- Oct 5, 2026sidecar 1.16.0 — chenrui333/homebrew-tap1 reaction · 1 comment
- Sep 23, 2026sidecar 1.14.0 — chenrui333/homebrew-tap1 reaction · 2 comments
- Sep 3, 2026sidecar 1.13.0 — chenrui333/homebrew-tap1 reaction · 1 comment
- Aug 31, 2026sidecar 1.11.2 — chenrui333/homebrew-tap1 reaction · 1 comment
- Aug 27, 2026sidecar 1.9.0 — chenrui333/homebrew-tap1 reaction · 1 comment
42 more on GitHub
- Aug 26, 2026sidecar 1.8.0 — chenrui333/homebrew-tap1 reaction · 1 comment
- Aug 25, 2026sidecar 1.7.0 — chenrui333/homebrew-tap1 reaction · 1 comment
- Aug 25, 2026sidecar 1.6.0 — chenrui333/homebrew-tap1 reaction · 1 comment
- Aug 24, 2026sidecar 1.5.0 — chenrui333/homebrew-tap1 reaction · 1 comment
- Aug 23, 2026sidecar 1.4.0 — chenrui333/homebrew-tap1 reaction · 1 comment
- Aug 21, 2026sidecar 1.3.0 — chenrui333/homebrew-tap1 reaction · 1 comment
- Aug 21, 2026sidecar 1.2.2 — chenrui333/homebrew-tap1 reaction · 1 comment
- Aug 20, 2026sidecar 1.2.1 — chenrui333/homebrew-tap1 reaction · 1 comment
- Aug 20, 2026sidecar 1.2.0 — chenrui333/homebrew-tap1 reaction · 1 comment
- Aug 19, 2026sidecar 1.1.1 — chenrui333/homebrew-tap1 reaction · 1 comment
- Aug 19, 2026sidecar 1.1.0 — chenrui333/homebrew-tap1 reaction · 1 comment
- Aug 18, 2026sidecar 1.0.3 — chenrui333/homebrew-tap1 reaction · 1 comment
- Aug 17, 2026sidecar 1.0.2 — chenrui333/homebrew-tap1 reaction · 1 comment
- Aug 17, 2026sidecar 1.0.1 — chenrui333/homebrew-tap1 reaction · 1 comment
- Aug 17, 2026sidecar 1.0.0 — chenrui333/homebrew-tap1 reaction · 1 comment
- Aug 14, 2026sidecar 0.99.1 — chenrui333/homebrew-tap1 reaction
- Aug 14, 2026sidecar 0.99.0 — chenrui333/homebrew-tap1 reaction
- Aug 13, 2026sidecar 0.98.0 — chenrui333/homebrew-tap1 reaction
- Aug 12, 2026sidecar 0.97.0 — chenrui333/homebrew-tap1 reaction
- Aug 11, 2026sidecar 0.96.0 — chenrui333/homebrew-tap1 reaction
- Aug 11, 2026sidecar 0.95.0 — chenrui333/homebrew-tap1 reaction
- Aug 8, 2026sidecar 0.93.0 — chenrui333/homebrew-tap1 reaction
- Aug 7, 2026sidecar 0.92.0 — chenrui333/homebrew-tap1 reaction
- Aug 2, 2026sidecar 0.91.0 — chenrui333/homebrew-tap1 reaction
- Jul 31, 2026sidecar 0.90.0 — chenrui333/homebrew-tap1 reaction
- Jul 30, 2026sidecar 0.89.0 — chenrui333/homebrew-tap1 reaction
- Jul 28, 2026sidecar 0.88.2 — chenrui333/homebrew-tap1 reaction
- Jul 27, 2026sidecar 0.88.1 — chenrui333/homebrew-tap1 reaction
- Jul 25, 2026sidecar 0.87.1 — chenrui333/homebrew-tap1 reaction
- Jun 19, 2026sidecar 0.86.0 — chenrui333/homebrew-tap1 reaction
- Oct 3, 2026agent-skills.github.marcus.sidecar: 1.14.0 → 1.15.1 — sudosubin/agents.nix0 reactions
- Oct 1, 2026sidecar 1.15.1 — chenrui333/homebrew-tap0 reactions · 2 comments
- Sep 29, 2026agent-skills.github.marcus.sidecar: init at 1.14.0 — sudosubin/agents.nix0 reactions
- Sep 7, 2026Add Sidecar — manuelmeurer/agentmgmt0 reactions · 1 comment
- Apr 18, 2026sidecar 0.84.0 — chenrui333/homebrew-tap0 reactions
- Apr 17, 2026Feedback — sidequery/ghostree0 reactions
- Mar 24, 2026sidecar 0.83.0 — chenrui333/homebrew-tap0 reactions
- Mar 21, 2026sidecar 0.80.0 — chenrui333/homebrew-tap0 reactions
- Mar 21, 2026sidecar 0.79.0 — chenrui333/homebrew-tap0 reactions
- Mar 10, 2026sidecar 0.78.0 — chenrui333/homebrew-tap0 reactions
- Feb 10, 2026Research: Deep analysis of Sidecar - alignment check and alternatives — JulianDouma/speckle0 reactions
- Feb 9, 2026[Feature]: Persistent plan/todo tracking and checkpoints between plans — code-yeongyu/oh-my-openagent0 reactions · 6 comments
On Bluesky · 1
- Mar 4, 2026Great write up! The failures are especially valuable, watching this very closely. It might make sense to move merges to a subagent of the… — @faz.ms1 likes and repost
In this repository20 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- coordinate-agentsSkill
- create-adapterSkill
- create-modalSkill
- create-pluginSkill
- create-promptSkill
- create-themeSkill
- drag-paneSkill
- feature-flagsSkill
- keyboard-shortcutsSkill
- merge-strategySkill
- port-herdr-integrationSkill
- profile-memorySkill
- project-switchingSkill
- release-sidecarSkill
- shell-integrationSkill
- sidecar-websiteSkill
- ui-featuresSkill
- worktree-switchingSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 3 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 103
Always show confirmation when the session is alive, regardless of file modification status.
- Distinctive: line 115
Check session alive status:
- Distinctive: line 257
Always confirm on click-away: when session is alive - prevents accidental data loss
- Very specific: line 259
Never query tmux synchronously in View(): - use cached content from tty.Model.View()
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Inline Editor Implementation
Overview
The inline editor (tmux_inline_edit) lets users edit files directly within the file browser preview pane using their preferred terminal editor (vim, nvim, nano, etc.) without leaving the TUI. The file tree remains visible during editing.
Core Principle: This is NOT a terminal emulator. Tmux manages the PTY backend; Sidecar acts as an input/output relay, similar to the workspace plugin's interactive mode.
Architecture
Components
- Entry Layer (
internal/plugins/filebrowser/inline_edit.go): Creates tmux sessions, manages editor lifecycle - Rendering Layer (
internal/plugins/filebrowser/view.go,inline_edit.go): Renders editor content within preview pane - Input Layer (
internal/plugins/filebrowser/plugin.go,mouse.go): Routes keys/clicks to editor or confirmation dialog - TTY Model (
internal/tty/tty.go): Handles tmux capture, cursor overlay, and input forwarding
Data Flow
User presses 'e' on file
-> enterInlineEditMode()
-> tmux new-session -d -s {sessionName} {editor} {path}
-> InlineEditStartedMsg
-> handleInlineEditStarted()
-> tty.Model.Enter()
-> Start polling tmux capture-pane
-> renderInlineEditorContent() in preview pane
-> User types -> tty.Model forwards to tmux
-> User exits -> SessionDeadMsg or exit keys
-> exitInlineEditMode()
-> Refresh previewKey Files
| File | Purpose |
internal/plugins/filebrowser/inline_edit.go | Editor lifecycle, confirmation dialog, dimension calculations |
internal/plugins/filebrowser/view.go | Preview pane rendering, gradient border |
internal/plugins/filebrowser/mouse.go | Click-away detection |
internal/plugins/filebrowser/plugin.go | State management, Update routing |
internal/tty/tty.go | TTY model for tmux interaction (shared with workspace) |
internal/app/update.go | App-level key routing for inline edit context |
Critical Implementation Details
1. Preview Pane Rendering (Not Full-Screen)
The editor renders within renderPreviewPane(), NOT as a full-screen takeover. The file tree stays visible.
// view.go - renderPreviewPane()
func (p *Plugin) renderPreviewPane(visibleHeight int) string {
if p.inlineEditMode && p.inlineEditor != nil && p.inlineEditor.IsActive() {
return p.renderInlineEditorContent(visibleHeight)
}
// ... normal preview rendering
}2. Dimension Calculations
The tty.Model needs exact dimensions matching the preview pane content area:
func (p *Plugin) calculateInlineEditorWidth() int {
if !p.treeVisible {
return p.width - 4 // borders + padding
}
p.calculatePaneWidths()
return p.previewWidth - 4
}
func (p *Plugin) calculateInlineEditorHeight() int {
paneHeight := p.height
innerHeight := paneHeight - 2 // pane borders
contentHeight := innerHeight - 2 // header lines
if len(p.tabs) > 1 {
contentHeight-- // tab line
}
return contentHeight
}These MUST stay in sync with renderInlineEditorContent() layout calculations.
3. Confirmation Behavior
Rule: session alive = show confirmation, session dead = exit immediately.
Always show confirmation when the session is alive, regardless of file modification status. Vim's modification status cannot be reliably detected externally.
func (p *Plugin) isInlineEditSessionAlive() bool {
if p.inlineEditSession == "" {
return false
}
err := exec.Command("tmux", "has-session", "-t", p.inlineEditSession).Run()
return err == nil
}Check session alive status:
- At the start of
Update()when in inline edit mode - if dead, exit immediately - In click-away handling - if dead, skip confirmation and clean up
4. Exit Confirmation Dialog
State fields:
showExitConfirmation bool // Dialog visible
pendingClickRegion string // Where user clicked
pendingClickData interface{} // Click data (tree index, tab index)
exitConfirmSelection int // 0=Save&Exit, 1=Exit without saving, 2=CancelOptions:
- Save & Exit: Sends editor-appropriate save-and-quit sequence, waits for session death
- Exit without saving: Kills tmux session immediately
- Cancel: Returns to editing
5. Click-Away Detection
Mouse regions are registered during render. Clicks between items may miss regions, so always include position-based fallback:
if p.inlineEditMode && p.inlineEditor != nil && p.inlineEditor.IsActive() {
action := p.mouseHandler.HandleMouse(msg)
handleClickAway := func(regionID string, regionData interface{}) (*Plugin, tea.Cmd) {
if !p.isInlineEditSessionAlive() {
p.exitInlineEditMode()
p.pendingClickRegion = regionID
p.pendingClickData = regionData
return p.processPendingClickAction()
}
p.pendingClickRegion = regionID
p.pendingClickData = regionData
p.showExitConfirmation = true
p.exitConfirmSelection = 0
return p, nil
}
if action.Type == mouse.ActionClick {
if action.Region != nil {
switch action.Region.ID {
case regionTreePane, regionTreeItem, regionPreviewTab:
return handleClickAway(action.Region.ID, action.Region.Data)
}
}
// Fallback: position-based detection
if p.treeVisible && action.X < p.treeWidth {
return handleClickAway(regionTreePane, nil)
}
}
// Forward to tty model
return p, p.inlineEditor.Update(msg)
}6. Gradient Border Feedback
Visual indicator that edit mode is active:
if p.inlineEditMode && p.inlineEditor != nil && p.inlineEditor.IsActive() {
rightPane = styles.RenderPanelWithGradient(previewContent, p.previewWidth,
paneHeight, styles.GetInteractiveGradient())
}7. Mouse Support (SGR Protocol)
Full mouse interaction including text selection via SGR (1006) protocol. Mouse events are forwarded to the tty model which translates them into SGR escape sequences: \x1b[<button;x;y;M/m where M = press/drag, m = release.
8. Multi-Editor Support
sendEditorSaveAndQuit() detects which editor is running and sends the appropriate sequence:
| Editor | Save & Quit Command |
| vim, nvim, vi | Escape :wq Enter |
| nano | Ctrl+O Enter Ctrl+X |
| emacs | Ctrl+X Ctrl+S Ctrl+X Ctrl+C |
| helix | Escape :wq Enter |
| micro | Ctrl+S Ctrl+Q |
| kakoune | Escape :write-quit Enter |
| joe | Ctrl+K X |
| ne | Escape :SaveQuit Enter |
| amp | Ctrl+S Ctrl+Q |
Exit Paths
| Method | Confirmation | Description |
Ctrl+\ | No | Immediate exit (tty.Config.ExitKey) |
| Double-ESC | No | Exit with 150ms delay (vim ESC compatibility) |
:q, :wq in vim | No | Normal editor exit, session death detected |
| Click tree/tab | Yes (if alive) | Shows confirmation when session alive; exits immediately if dead |
State Management
Plugin State (plugin.go)
inlineEditor *tty.Model // Embeddable tty model
inlineEditMode bool // Currently editing
inlineEditSession string // Tmux session name
inlineEditFile string // File being edited
showExitConfirmation bool
pendingClickRegion string
pendingClickData interface{}
exitConfirmSelection intUpdate Priority (plugin.go)
func (p *Plugin) Update(msg tea.Msg) (plugin.Plugin, tea.Cmd) {
// 1. Handle exit confirmation dialog FIRST
if p.showExitConfirmation { /* j/k navigation, Enter confirm, Esc cancel */ }
// 2. Handle inline edit mode
if p.inlineEditMode && p.inlineEditor.IsActive() { /* Delegate to tty.Model */ }
// 3. Normal plugin handling
}App-Level Key Routing
The app intercepts global shortcuts (q, 1-5, `, ~, ?, !, @) before plugins. For inline edit to receive ALL keys, internal/app/update.go must recognize the context:
if m.activeContext == "workspace-interactive" || m.activeContext == "file-browser-inline-edit" {
// Forward ALL keys to plugin
}The plugin returns "file-browser-inline-edit" from FocusContext().
Common Pitfalls
- Do NOT render full-screen - render within preview pane only, keeping file tree visible
- Always include position-based click fallback - mouse regions may not cover every pixel
- Always confirm on click-away when session is alive - prevents accidental data loss
- Check
IsActive()on every message - tty model can become inactive asynchronously; without this check, users get a blank screen after vim exits - Never query tmux synchronously in View() - use cached content from
tty.Model.View() - Handle tab row clicks by Y position BEFORE region-based detection - prevents incorrect handling as preview pane clicks
- Ensure app-level key routing recognizes
"file-browser-inline-edit"context - otherwise typingqin vim triggers quit instead of inserting character
Feature Flag
Gated behind tmux_inline_edit. Enable in ~/.config/sidecar/config.json:
{ "features": { "tmux_inline_edit": true } }Fallback: features.IsEnabled(features.TmuxInlineEdit.Name) returns false -> opens external editor.
Keyboard Shortcuts
| Key | Command | Description |
e | edit | Edit file inline (within preview pane) |
E | edit-external | Edit in full terminal (suspends TUI) |
Registered in:
internal/plugins/filebrowser/plugin.go-Commands()methodinternal/plugins/filebrowser/handlers.go- Key handlinginternal/keymap/bindings.go- Key bindings forfile-browser-treeandfile-browser-previewcontexts
References
- Interactive shell guide:
docs/guides/deprecated/interactive-shell-implementation.md - TTY model:
internal/tty/tty.go - Feature flags:
internal/features/features.go
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

