git: a creation gate that never writes history, a git tab with Paperclip's worktree scan, and a warning line in every pane
This commit is contained in:
11
tui/main.go
11
tui/main.go
@@ -40,6 +40,14 @@ func main() {
|
||||
fmt.Fprintln(os.Stderr, "warning: PAPERCLIP_BOARD_KEY is not set, so replies and status changes will be refused")
|
||||
}
|
||||
|
||||
// One git read, here, before the terminal is taken over: the banner in every
|
||||
// pane depends on it and no git command may run inside Update or View.
|
||||
screenFolder := *folder
|
||||
if screenFolder == "" {
|
||||
screenFolder, _ = os.Getwd()
|
||||
}
|
||||
setGitBanner(screenFolder)
|
||||
|
||||
var m tea.Model
|
||||
switch *screen {
|
||||
case "board":
|
||||
@@ -138,7 +146,8 @@ func main() {
|
||||
|
||||
// Alternate screen: TUIOS keeps its own scrollback, and a full-screen
|
||||
// program that redraws in place must not fight it.
|
||||
p := tea.NewProgram(m, tea.WithAltScreen(), tea.WithMouseCellMotion())
|
||||
// The setup warning is drawn once for the whole screen, not once per panel.
|
||||
p := tea.NewProgram(bannerModel{inner: m}, tea.WithAltScreen(), tea.WithMouseCellMotion())
|
||||
if _, err := p.Run(); err != nil {
|
||||
fmt.Fprintln(os.Stderr, err)
|
||||
os.Exit(1)
|
||||
|
||||
Reference in New Issue
Block a user