@@ -2,6 +2,7 @@ package commands
22
33import (
44 "encoding/json"
5+ "log/slog"
56 "slices"
67 "strings"
78
@@ -155,6 +156,9 @@ func (k Command) Matches(msg tea.KeyPressMsg, leader bool) bool {
155156func parseBindings (bindings ... string ) []Keybinding {
156157 var parsedBindings []Keybinding
157158 for _ , binding := range bindings {
159+ if binding == "none" {
160+ continue
161+ }
158162 for p := range strings .SplitSeq (binding , "," ) {
159163 requireLeader := strings .HasPrefix (p , "<leader>" )
160164 keybinding := strings .ReplaceAll (p , "<leader>" , "" )
@@ -219,7 +223,6 @@ func LoadFromConfig(config *opencode.Config) CommandRegistry {
219223 {
220224 Name : SessionUnshareCommand ,
221225 Description : "unshare session" ,
222- Keybindings : parseBindings ("<leader>u" ),
223226 Trigger : []string {"unshare" },
224227 },
225228 {
@@ -375,15 +378,14 @@ func LoadFromConfig(config *opencode.Config) CommandRegistry {
375378 // Remove share/unshare commands if sharing is disabled
376379 if config .Share == opencode .ConfigShareDisabled &&
377380 (command .Name == SessionShareCommand || command .Name == SessionUnshareCommand ) {
381+ slog .Info ("Removing share/unshare commands" )
378382 continue
379383 }
380384 if keybind , ok := keybinds [string (command .Name )]; ok && keybind != "" {
381- if keybind == "none" {
382- continue
383- }
384385 command .Keybindings = parseBindings (keybind )
385386 }
386387 registry [command .Name ] = command
387388 }
389+ slog .Info ("Loaded commands" , "commands" , registry )
388390 return registry
389391}
0 commit comments