MCPcopy Create free account
hub / github.com/codehamr/codehamr / splashLines

Method splashLines

internal/tui/render.go:273–300  ·  view source on GitHub ↗

splashLines builds the identity block for tea.Println. Below wordmarkWidth the ASCII art soft-wraps into garbage, so collapse to plain text.

()

Source from the content-addressed store, hash-verified

271 styleDim.Render(strings.Repeat("─", max(m.width-1, 1))),
272 m.ta.View(),
273 m.renderStatusBar(),
274 )
275 return strings.Join(pieces, "\n")
276}
277
278// noPosixShell: tools.Bash runs every command through /bin/sh, which a native
279// Windows host does not have, so every tool call there fails - a new user's
280// first turn would be a confusing five-failure streak ending in a nudge. Say
281// it once, up front. Computed once at init: splashLines re-runs on every
282// resize, and main's pre-TUI screen wipe erases anything printed earlier.
283var noPosixShell = func() bool {
284 if runtime.GOOS != "windows" {
285 return false
286 }
287 _, err := os.Stat("/bin/sh")
288 return err != nil
289}()
290
291// posixShellWarning is the one-line splash warning for noPosixShell hosts.
292const posixShellWarning = " ⚠ no POSIX shell: the bash tool needs /bin/sh and will fail every call - run codehamr inside WSL2 or a devcontainer."
293
294// splashLines builds the identity block for tea.Println. Below wordmarkWidth
295// the ASCII art soft-wraps into garbage, so collapse to plain text.
296func (m Model) splashLines() []string {
297 const wordmarkWidth = 70 // cells needed for CODE+HAMR side-by-side
298 if m.width >= wordmarkWidth {
299 lines := []string{""}
300 for i := range splashCode {
301 lines = append(lines, " "+styleDim.Render(splashCode[i])+styleHamr.Render(splashHamr[i]))
302 }
303 lines = append(lines,

Callers 2

handleWindowSizeMethod · 0.95
handleResizeSettleMethod · 0.95

Calls 1

ActiveProfileMethod · 0.80

Tested by

no test coverage detected