Skip to content

Commit df58161

Browse files
committed
fixes
1 parent 5b819ca commit df58161

File tree

3 files changed

+38
-7
lines changed

3 files changed

+38
-7
lines changed

cmd/push-validator/cmd_dashboard.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import (
1212
"golang.org/x/term"
1313

1414
"github.com/pushchain/push-validator-cli/internal/dashboard"
15+
"github.com/pushchain/push-validator-cli/internal/ui"
1516
)
1617

1718
// dashboardFlags holds the parsed flag values for the dashboard command.
@@ -150,6 +151,10 @@ func runDashboardInteractive(opts dashboard.Options) error {
150151
return fmt.Errorf("dashboard error: %w", err)
151152
}
152153

154+
// Flush stale terminal responses (cursor position reports, focus events)
155+
// that arrive after bubbletea exits the alternate screen
156+
ui.FlushStdinWithTimeout(50 * time.Millisecond)
157+
153158
return nil
154159
}
155160

install.sh

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1474,8 +1474,17 @@ if ! command -v cosmovisor >/dev/null 2>&1; then
14741474
GO_EXIT=$?
14751475
if [[ $GO_EXIT -eq 0 ]]; then
14761476
rm -f "$COSMOVISOR_LOG"
1477-
# Ensure go bin directory is in PATH for current session
1478-
export PATH="${GOBIN:-${GOPATH:-$HOME/go}/bin}:$PATH"
1477+
# Ensure go bin directory is in PATH for current session and future shells
1478+
GO_BIN_DIR="${GOBIN:-${GOPATH:-$HOME/go}/bin}"
1479+
export PATH="$GO_BIN_DIR:$PATH"
1480+
# Persist to shell profile if not already there
1481+
SHELL_CONFIG="${HOME}/.bashrc"
1482+
[[ "${SHELL##*/}" = "zsh" ]] && SHELL_CONFIG="${HOME}/.zshrc"
1483+
if ! grep -q "$GO_BIN_DIR" "$SHELL_CONFIG" 2>/dev/null; then
1484+
echo "" >> "$SHELL_CONFIG"
1485+
echo "# Go bin directory (cosmovisor)" >> "$SHELL_CONFIG"
1486+
echo "export PATH=\"$GO_BIN_DIR:\$PATH\"" >> "$SHELL_CONFIG"
1487+
fi
14791488
ok "Cosmovisor v1.7.1 installed"
14801489
else
14811490
err "Cosmovisor installation failed (see $COSMOVISOR_LOG)"

internal/cosmovisor/detector.go

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,29 @@ func findCosmovisor() string {
5858
}
5959
}
6060

61-
// Fall back to PATH lookup
62-
path, err := exec.LookPath("cosmovisor")
63-
if err != nil {
64-
return ""
61+
// Check PATH lookup
62+
if path, err := exec.LookPath("cosmovisor"); err == nil {
63+
return path
6564
}
66-
return path
65+
66+
// Check common Go binary locations (go install puts binaries here)
67+
candidates := []string{}
68+
if gobin := os.Getenv("GOBIN"); gobin != "" {
69+
candidates = append(candidates, filepath.Join(gobin, "cosmovisor"))
70+
}
71+
if gopath := os.Getenv("GOPATH"); gopath != "" {
72+
candidates = append(candidates, filepath.Join(gopath, "bin", "cosmovisor"))
73+
}
74+
if home, err := os.UserHomeDir(); err == nil {
75+
candidates = append(candidates, filepath.Join(home, "go", "bin", "cosmovisor"))
76+
}
77+
for _, c := range candidates {
78+
if _, err := os.Stat(c); err == nil {
79+
return c
80+
}
81+
}
82+
83+
return ""
6784
}
6885

6986
// IsAvailable returns true if cosmovisor binary is found.

0 commit comments

Comments
 (0)