Documentation
¶
Overview ¶
Package tui is conch's Bubble Tea client: a tree of machines, projects, branches and agents beside the selected pane, branch changes or project.
Index ¶
- Constants
- Variables
- func AutopilotPolicy(v config.VerifyCfg) proto.AutopilotPolicy
- func MatchSpans(plain, q string) [][2]int
- func RestartEnv(model tea.Model) []string
- func RestartRequested(model tea.Model) bool
- func SettingsChoices(agents []string) configweb.Choices
- func TerminalColors(theme, accent string) (bg, fg, cursor, selection string)
- func UserThemeProblems() []string
- func UserThemesDir() string
- func WholeSequences(f *os.File) io.Reader
- type AppShortcut
- type Model
Constants ¶
const AppWindowEnv = "CONCH_APP_WINDOW"
AppWindowEnv is the variable `conch app` sets in the window it opens.
Variables ¶
var AppShortcuts = func() []AppShortcut { keys := []AppShortcut{ {"", "t", "c"}, {"", "w", "x"}, {"shift", "w", "&"}, {"", "d", "%"}, {"shift", "d", "\""}, {"shift", "]", "n"}, {"shift", "[", "p"}, {"", "]", "o"}, {"", "[", ";"}, {"shift", "enter", "z"}, {"", "k", "/"}, {"", ".", "!"}, {"", "/", "?"}, {"", "n", "N"}, {"alt", "up", "\x1b[A"}, {"alt", "down", "\x1b[B"}, {"alt", "right", "\x1b[C"}, {"alt", "left", "\x1b[D"}, } for d := '1'; d <= '9'; d++ { keys = append(keys, AppShortcut{"", string(d), string(d)}) } return keys }()
Functions ¶
func AutopilotPolicy ¶ added in v0.1.9
func AutopilotPolicy(v config.VerifyCfg) proto.AutopilotPolicy
AutopilotPolicy is the policy a server acts on from [verify]: what the TUI hands every server, and `conch autopilot push` for a window that is not the TUI (Conch.app), so it is one rule wherever it is sent from.
func MatchSpans ¶ added in v0.1.9
MatchSpans lists the [from, to) cells where q occurs in plain text, with the same smart case as the server's search: a query without capitals matches either case.
func RestartEnv ¶
RestartEnv is the environment for the TUI restarted from model: it updates remote machines, except those unticked for this update.
func RestartRequested ¶
RestartRequested reports whether the TUI quit to restart onto a new build.
func SettingsChoices ¶ added in v0.1.9
SettingsChoices is what the settings page offers: the themes and accents this build draws, the sandbox providers it knows, and agents (the four supported ones when none are given). conch config web passes none, since it has no machine to ask.
func TerminalColors ¶ added in v0.1.9
TerminalColors are what a terminal conch configures for itself should draw with under a theme (and an accent override, as applyTheme takes it): its background and text, the cursor in the accent, and a selection in the theme's dim selection colour. `conch app` writes them into the window it opens, so that window is the theme rather than a terminal's stock black with conch's colours on it.
func UserThemeProblems ¶ added in v0.1.9
func UserThemeProblems() []string
UserThemeProblems says what was wrong with the theme files left out at the last reading, for the status bar and conch doctor.
func UserThemesDir ¶ added in v0.1.9
func UserThemesDir() string
UserThemesDir is where conch looks for themes of your own.
func WholeSequences ¶ added in v0.1.9
WholeSequences wraps the terminal conch reads keys and mouse from so that no read ends partway through an escape sequence.
Bubble Tea reads 256 bytes at a time and parses each read on its own. A fast wheel or a moving pointer fills that buffer with mouse reports, and when one is cut at the edge — `ESC [ < 6 5 ; 1 3` | `0 ; 4 3 M` — it reports the halves as keys: alt+[ and then the runes `<65;130;43M`. conch forwards keys to the focused pane, so the shell there printed `65;130;43M` at its prompt, a few at a time, while somebody scrolled. Holding the unfinished tail back for the next read gives Bubble Tea the whole report.
It is still the terminal (Fd, Name, Write, Close are the file's), so Bubble Tea puts it in raw mode and waits on it as it would on stdin.
Types ¶
type AppShortcut ¶ added in v0.1.9
type AppShortcut struct {
Mods string // "", "shift" or "alt", beside ⌘
Key string // a letter, digit, punctuation, or enter/up/down/left/right
Send string // what follows the prefix
}
AppShortcut is a ⌘ shortcut in conch's own window: the terminal sends conch's prefix and then Send, so it does exactly what that key does in any terminal and the TUI needs nothing of its own to take it. These are the shortcuts every macOS application has (⌘T a tab, ⌘W close, ⌘1–9 a tab), put on what conch calls the same thing, and they replace the terminal's own — which would make a tab or a split of the *terminal*, outside conch, where nothing of conch's can see it. cmd/conch writes them into the terminal's configuration; the palette names them.
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model is the root Bubble Tea model.
func New ¶
New builds the TUI around a connected local client. Saved remote machines connect in the background once the program starts.
func (Model) LaunchedIn ¶ added in v0.1.7
LaunchedIn records the folder conch was started in, for the first list of the local machine's projects to place the tree by. The TUI's own tests never call it: they run inside conch's repository. A TUI restarted onto a new build keeps where you were instead.
func (Model) Update ¶
Update handles a message, then schedules clearing the status bar message when one is showing.
Source Files
¶
- accounts.go
- actions.go
- adapt.go
- appwindow.go
- attempts.go
- autopilot.go
- background.go
- brain.go
- broadcast.go
- browser.go
- bug.go
- catalog.go
- changes.go
- checkoutport.go
- cicard.go
- cleanup.go
- clipboard.go
- cloud.go
- cmdpalette.go
- commits.go
- compare.go
- configwatch.go
- configweb.go
- cost.go
- created.go
- devices.go
- diffedit.go
- diffsplit.go
- diffwords.go
- drop.go
- fileicons.go
- files.go
- folders.go
- gitinit.go
- gitpanel.go
- guide.go
- harvest.go
- health.go
- hoststatus.go
- hover.go
- hunks.go
- input.go
- integrations.go
- issues.go
- keys.go
- launch.go
- layout.go
- library.go
- limitalerts.go
- limits.go
- limitsview.go
- linkclick.go
- links.go
- machine.go
- model.go
- monitor.go
- mouse.go
- move.go
- move_project.go
- notify.go
- overlay.go
- pair.go
- paneref.go
- plaintask.go
- pointer.go
- previews.go
- projectintegrations.go
- prompt.go
- queue.go
- resources.go
- review.go
- reviewer.go
- safeview.go
- sandbox.go
- sandboxran.go
- schedule.go
- scope.go
- scrollbar.go
- scrollsearch.go
- selection.go
- sessions.go
- settings.go
- setup.go
- setupsync.go
- skill.go
- spaces.go
- ssh.go
- sshhosts.go
- state.go
- statusbar.go
- stdin.go
- tabs.go
- theme.go
- tmuxextras.go
- transcript.go
- transfer.go
- tree.go
- uisync.go
- update.go
- userthemes.go
- verify.go
- verifyfix.go
- view.go
- view_share.go