Documentation
¶
Overview ¶
Package cdshell owns the __TREEPAD_CD__ shell-bridge protocol.
The tp shell wrapper sets TREEPAD_CD_FD=3 and redirects fd 3 into its $(...) capture, letting tp's stdout go to the real terminal. When the env var is absent (stale wrapper, direct binary invocation, tests) EmitCD falls back to writing the "__TREEPAD_CD__\t<path>\n" sentinel to d.Out.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EmitCD ¶
EmitCD writes the __TREEPAD_CD__ sentinel for the path. In the fallback path (no fd-3 sentinel), it also writes a human-readable line.
func MaybeWarnStaleWrapper ¶
MaybeWarnStaleWrapper prints a one-line stderr hint when an agent_command is configured but the new shell wrapper has not been installed.
Types ¶
type BaseInput ¶
type BaseInput struct {
// Cwd overrides os.Getwd for testing.
Cwd string
}
BaseInput parameterises a tp base invocation.
type Deps ¶
type Deps struct {
Out io.Writer
Log Logger
IsTerminal func(w io.Writer) bool
// CDSentinel, when non-nil, returns the writer EmitCD uses instead of
// the fd-3 probe. Tests set this to a bytes.Buffer.
CDSentinel func() io.Writer
Runner worktree.CommandRunner
}
Deps are the external dependencies cdshell needs.