Drop the icon sample row; give tool panes a working PATH and a reason to stay open; answer the open questions
This commit is contained in:
@@ -170,6 +170,12 @@ func (m boardModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
||||
case "down", "j":
|
||||
m.toolAt = min(len(tools)-1, m.toolAt+1)
|
||||
return m, nil
|
||||
case "g":
|
||||
m.toolAt = 0
|
||||
return m, nil
|
||||
case "G":
|
||||
m.toolAt = len(tools) - 1
|
||||
return m, nil
|
||||
case "enter":
|
||||
t := tools[m.toolAt]
|
||||
m.tools = false
|
||||
|
||||
@@ -339,13 +339,6 @@ func (m repairModel) healthLines() []string {
|
||||
mutedStyle2().Render(truncateVisible(c.detail, max(10, m.width-30)))))
|
||||
}
|
||||
out = append(out, "")
|
||||
// The one way to tell whether the terminal is drawing the font: show the
|
||||
// glyphs themselves. Nothing else on this screen answers that question.
|
||||
out = append(out, " "+mutedStyle2().Render("icons ")+
|
||||
icons.Done+" "+icons.Running+" "+icons.Blocked+" "+icons.Review+" "+
|
||||
icons.Branch+" "+icons.Folder+" "+icons.Cost+" "+
|
||||
dimStyle().Render("if these are boxes, this terminal is not using a Nerd Font"))
|
||||
out = append(out, "")
|
||||
if failed == 0 {
|
||||
out = append(out, " "+lipgloss.NewStyle().Foreground(lipgloss.Color(active.Success)).Render("everything checked passes"))
|
||||
} else {
|
||||
|
||||
@@ -36,7 +36,9 @@ var tools = []tool{
|
||||
{"yazi", "yazi", "files"},
|
||||
{"nvim", "nvim", "editing one file"},
|
||||
{"fzf", "fzf", "picking anything"},
|
||||
{"ocr", "ocr review", "the review of the current change, in the terminal"},
|
||||
// A review that finds nothing exits in a second, which looks like a broken
|
||||
// pane. It is given a last line so the output can be read before closing.
|
||||
{"ocr", "ocr review --color never; printf '\\npress enter to close\\n'; read -r _", "the review of the current change"},
|
||||
}
|
||||
|
||||
// currentWorkspace finds the workspace this program is drawn in. TUIOS knows;
|
||||
@@ -96,8 +98,13 @@ func openTool(folder, name string) error {
|
||||
}
|
||||
log, _ := os.Create(filepath.Join(os.TempDir(), "paperclip-harness-tool.log"))
|
||||
|
||||
// A pane started this way gets a smaller PATH than an interactive shell, so
|
||||
// the places a person's tools actually live are put back before the tool
|
||||
// runs. Without this, ocr is "command not found" inside its own pane.
|
||||
prelude := `export PATH="$HOME/.local/bin:$HOME/.nix-profile/bin:` +
|
||||
`/run/current-system/sw/bin:/etc/profiles/per-user/$USER/bin:$PATH"; `
|
||||
cmd := exec.Command("tuios", "new-window", chosen.name, "-s", session,
|
||||
"--workspace", ws, "--cwd", folder, "--", "/bin/sh", "-c", chosen.command)
|
||||
"--workspace", ws, "--cwd", folder, "--", "/bin/sh", "-c", prelude+chosen.command)
|
||||
cmd.Stdout = log
|
||||
cmd.Stderr = log
|
||||
cmd.SysProcAttr = &syscall.SysProcAttr{Setsid: true}
|
||||
|
||||
@@ -136,6 +136,12 @@ func (m workModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
||||
case "down", "j":
|
||||
m.toolAt = min(len(tools)-1, m.toolAt+1)
|
||||
return m, nil
|
||||
case "g":
|
||||
m.toolAt = 0
|
||||
return m, nil
|
||||
case "G":
|
||||
m.toolAt = len(tools) - 1
|
||||
return m, nil
|
||||
case "enter":
|
||||
t := tools[m.toolAt]
|
||||
m.tools = false
|
||||
|
||||
Reference in New Issue
Block a user