diff --git a/internal/config/config.go b/internal/config/config.go index 8c9af2a6c6837a5bc36eb3313a78e5c753aedada..090333b631419fb6716a61cf508f8c560b5b77f4 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -130,7 +130,7 @@ type LSPConfig struct { type TUIOptions struct { CompactMode bool `json:"compact_mode,omitempty" jsonschema:"description=Enable compact mode for the TUI interface,default=false"` DiffMode string `json:"diff_mode,omitempty" jsonschema:"description=Diff mode for the TUI interface,enum=unified,enum=split"` - ReduceAnimations bool `json:"reduce_animations,omitempty" jsonschema:"description=Reduce animations in the TUI,default=false"` + ReduceAnimations *bool `json:"reduce_animations,omitempty" jsonschema:"description=Reduce animations in the TUI,default=false"` // Here we can add themes later or any TUI related options // diff --git a/internal/config/load.go b/internal/config/load.go index a219b7d1c848b3eea76809fca96e8e4049838365..28c49522676340ded42784a3b25d034c62a4c03c 100644 --- a/internal/config/load.go +++ b/internal/config/load.go @@ -74,6 +74,11 @@ func Load(workingDir, dataDir string, debug bool) (*Config, error) { assignIfNil(&cfg.Options.TUI.Completions.MaxItems, items) } + if isSSH() { + slog.Warn("Running over SSH, will enable reduce animations") + assignIfNil(&cfg.Options.TUI.ReduceAnimations, true) + } + // Load known providers, this loads the config from catwalk providers, err := Providers(cfg) if err != nil { @@ -674,3 +679,5 @@ func isInsideWorktree() bool { ).CombinedOutput() return err == nil && strings.TrimSpace(string(bts)) == "true" } + +func isSSH() bool { return os.Getenv("SSH_TTY") != "" } diff --git a/internal/tui/components/chat/messages/messages.go b/internal/tui/components/chat/messages/messages.go index d7379e47f5dd7a85e2db30a0a14b91deaed7ae8c..3f25d19527da11ee3810041e7104a9757d3baa87 100644 --- a/internal/tui/components/chat/messages/messages.go +++ b/internal/tui/components/chat/messages/messages.go @@ -431,5 +431,6 @@ func isReduceAnimations() bool { cfg := config.Get() return cfg.Options != nil && cfg.Options.TUI != nil && - cfg.Options.TUI.ReduceAnimations + cfg.Options.TUI.ReduceAnimations != nil && + *cfg.Options.TUI.ReduceAnimations }