@@ -5,6 +5,7 @@ import (
55 "log/slog"
66 "net/http"
77 "os"
8+ "runtime"
89
910 _ "net/http/pprof" // profiling
1011
@@ -12,9 +13,14 @@ import (
1213
1314 "github.com/charmbracelet/crush/internal/cmd"
1415 "github.com/charmbracelet/crush/internal/log"
16+ "github.com/charmbracelet/lipgloss/v2"
1517)
1618
1719func main() {
20+ if runtime.GOOS == "windows" {
21+ showWindowsWarning()
22+ }
23+
1824 defer log.RecoverPanic("main", func() {
1925 slog.Error("Application terminated due to unhandled panic")
2026 })
@@ -30,3 +36,23 @@ func main() {
3036
3137 cmd.Execute()
3238}
39+
40+func showWindowsWarning() {
41+ content := lipgloss.JoinVertical(lipgloss.Left,
42+ lipgloss.NewStyle().Bold(true).Render("WARNING:")+" Crush is experimental on Windows!",
43+ "",
44+ "While we work on it, we recommend WSL2 for a better experience.",
45+ "",
46+ lipgloss.NewStyle().Italic(true).Render("Press Enter to continue..."),
47+ )
48+ content = lipgloss.NewStyle().
49+ Border(lipgloss.RoundedBorder()).
50+ Padding(1).
51+ Render(content)
52+ content += "\n"
53+
54+ fmt.Print(content)
55+
56+ var input string
57+ fmt.Scanln(&input)
58+}