feat(tui): remove share commands from help if sharing is disabled (#1087)

This commit is contained in:
Timo Clasen 2025-07-17 11:28:12 +02:00 committed by GitHub
parent 3ce3ac8e61
commit a493aec174
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -344,6 +344,10 @@ func LoadFromConfig(config *opencode.Config) CommandRegistry {
marshalled, _ := json.Marshal(config.Keybinds)
json.Unmarshal(marshalled, &keybinds)
for _, command := range defaults {
// Remove share/unshare commands if sharing is disabled
if config.Share == opencode.ConfigShareDisabled && (command.Name == SessionShareCommand || command.Name == SessionUnshareCommand) {
continue
}
if keybind, ok := keybinds[string(command.Name)]; ok && keybind != "" {
command.Keybindings = parseBindings(keybind)
}