Skip to content

Commit

Permalink
feat(notice): disable upgrade notice by default
Browse files Browse the repository at this point in the history
BREAKING CHANGE: changes `disable_notice: false` to `upgrade_notice`: true
  • Loading branch information
JanDeDobbeleer committed Sep 18, 2024
1 parent c744312 commit ea50f85
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 28 deletions.
4 changes: 2 additions & 2 deletions src/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ type Config struct {
Blocks []*Block `json:"blocks,omitempty" toml:"blocks,omitempty"`
Tooltips []*Segment `json:"tooltips,omitempty" toml:"tooltips,omitempty"`
Version int `json:"version" toml:"version"`
DisableNotice bool `json:"disable_notice,omitempty" toml:"disable_notice,omitempty"`
UpgradeNotice bool `json:"upgrade_notice,omitempty" toml:"upgrade_notice,omitempty"`
AutoUpgrade bool `json:"auto_upgrade,omitempty" toml:"auto_upgrade,omitempty"`
ShellIntegration bool `json:"shell_integration,omitempty" toml:"shell_integration,omitempty"`
MigrateGlyphs bool `json:"-" toml:"-"`
Expand Down Expand Up @@ -96,7 +96,7 @@ func (cfg *Config) Features() shell.Features {
feats = append(feats, shell.FTCSMarks)
}

if !cfg.AutoUpgrade && !cfg.DisableNotice {
if cfg.UpgradeNotice && !cfg.AutoUpgrade {
feats = append(feats, shell.Notice)
}

Expand Down
2 changes: 0 additions & 2 deletions src/config/load.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,5 @@ func loadConfig(env runtime.Environment) *Config {
return Default(env, true)
}

setDisableNotice(data, &cfg)

return &cfg
}
5 changes: 0 additions & 5 deletions src/config/notice_default.go

This file was deleted.

15 changes: 0 additions & 15 deletions src/config/notice_disable.go

This file was deleted.

4 changes: 2 additions & 2 deletions themes/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -4748,9 +4748,9 @@
"description": "https://ohmyposh.dev/docs/configuration/general#general-settings",
"default": ""
},
"disable_notice": {
"upgrade_notice": {
"type": "boolean",
"title": "Disable Upgrade Notice",
"title": "Enable Upgrade Notice",
"description": "https://ohmyposh.dev/docs/configuration/general#general-settings",
"default": false
},
Expand Down
4 changes: 2 additions & 2 deletions website/docs/configuration/general.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ For example, the following is a valid `--config` flag:
| `shell_integration` | `boolean` | `false` | enable shell integration using FinalTerm's OSC sequences. Works in bash, cmd (Clink v1.14.25+), fish, powershell and zsh |
| `enable_cursor_positioning` | `boolean` | `false` | enable fetching the cursor position in bash and zsh to allow automatic hiding of leading newlines when at the top of the shell |
| `patch_pwsh_bleed` | `boolean` | `false` | patch a PowerShell bug where the background colors bleed into the next line at the end of the buffer (can be removed when [this][pwsh-bleed] is merged) |
| `disable_notice` | `boolean` | `false` | disables the notice that a new upgrade is available when `auto_upgrade` is disabled |
| `auto_upgrade` | `boolean` | `false` | enable [automatic upgrades][upgrade] for Oh My Posh (supports Windows, macOS and Linux) |
| `upgrade_notice` | `boolean` | `false` | enable the notice that a new upgrade is available when `auto_upgrade` is disabled |
| `auto_upgrade` | `boolean` | `false` | enable [automatic upgrades][upgrade] for Oh My Posh (supports Windows, macOS and Linux) |
| `iterm_features` | `[]string` | `false` | enable iTerm2 specific features:<ul><li>`prompt_mark`: add the `iterm2_prompt_mark` [function][iterm2-si] for supported shells</li><li>`current_dir`: expose the current directory for iTerm2</li><li>`remote_host`: expose the current remote and user for iTerm2</li></ul> |

### JSON Schema Validation
Expand Down

0 comments on commit ea50f85

Please sign in to comment.