on main help sign in
feat(ui): transparent mode (#2087)

optional transparent mode. this is enabled by default on apple terminal as it doesn't reset properly. refs #1140 refs #1137 Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>

commitd0ed2c508fedb1c67ea4bae1438729f15cdcd8c2 authorCarlos Alexandro Becker <caarlos0@users.noreply.github.com> dateTue 3 Feb 2026, 14:50 (8 months ago) parentbf1c65e
3 files changed+18−2
internal/config/config.go+1 internal/config/load.go+7 internal/ui/model/ui.go+10−2
internal/config/config.go+1
@@ -204,6 +204,7 @@ type TUIOptions struct {
204204 //
205205
206206 Completions Completions `json:"completions,omitzero" jsonschema:"description=Completions UI options"`
207+ Transparent *bool `json:"transparent,omitempty" jsonschema:"description=Enable transparent background for the TUI interface,default=false"`
207208}
208209
209210// Completions defines options for the completions UI.
internal/config/load.go+7
@@ -62,6 +62,11 @@ func Load(workingDir, dataDir string, debug bool) (*Config, error) {
6262 assignIfNil(&cfg.Options.TUI.Completions.MaxItems, items)
6363 }
6464
65+ if isAppleTerminal() {
66+ slog.Warn("Detected Apple Terminal, enabling transparent mode")
67+ assignIfNil(&cfg.Options.TUI.Transparent, true)
68+ }
69+
6570 // Load known providers, this loads the config from catwalk
6671 providers, err := Providers(cfg)
6772 if err != nil {
@@ -792,3 +797,5 @@ func GlobalSkillsDirs() []string {
792797 filepath.Join(configBase, "agents", "skills"),
793798 }
794799}
800+
801+func isAppleTerminal() bool { return os.Getenv("TERM_PROGRAM") == "Apple_Terminal" }
internal/ui/model/ui.go+10−2
@@ -127,6 +127,8 @@ type UI struct {
127127 height int
128128 layout layout
129129
130+ isTransparent bool
131+
130132 focus uiFocusState
131133 state uiState
132134
@@ -296,8 +298,12 @@ func New(com *common.Common) *UI {
296298 // set initial state
297299 ui.setState(desiredState, desiredFocus)
298300
301+ opts := com.Config().Options
302+
299303 // disable indeterminate progress bar
300− ui.progressBarEnabled = com.Config().Options.Progress == nil || *com.Config().Options.Progress
304+ ui.progressBarEnabled = opts.Progress == nil || *opts.Progress
305+ // enable transparent mode
306+ ui.isTransparent = opts.TUI.Transparent != nil && *opts.TUI.Transparent
301307
302308 return ui
303309}
@@ -1884,7 +1890,9 @@ func (m *UI) Draw(scr uv.Screen, area uv.Rectangle) *tea.Cursor {
18841890func (m *UI) View() tea.View {
18851891 var v tea.View
18861892 v.AltScreen = true
1887− v.BackgroundColor = m.com.Styles.Background
1893+ if !m.isTransparent {
1894+ v.BackgroundColor = m.com.Styles.Background
1895+ }
18881896 v.MouseMode = tea.MouseModeCellMotion
18891897 v.WindowTitle = "crush " + home.Short(m.com.Config().WorkingDir())
18901898