diff options
| author | adamdotdevin <[email protected]> | 2025-08-01 09:30:42 -0500 |
|---|---|---|
| committer | adamdotdevin <[email protected]> | 2025-08-01 09:30:42 -0500 |
| commit | 6ebd828aa50fbf1315433b7fc4e0f834751e5836 (patch) | |
| tree | 797105c6ac07801053b07017d8ec40d429049bd2 | |
| parent | 022c979d287a21e341adaa1fe8bab77a8f40eb39 (diff) | |
| download | opencode-6ebd828aa50fbf1315433b7fc4e0f834751e5836.tar.gz opencode-6ebd828aa50fbf1315433b7fc4e0f834751e5836.zip | |
fix: unshare command missing
| -rw-r--r-- | packages/tui/internal/commands/command.go | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/packages/tui/internal/commands/command.go b/packages/tui/internal/commands/command.go index 8d1f3a6c4..f87794796 100644 --- a/packages/tui/internal/commands/command.go +++ b/packages/tui/internal/commands/command.go @@ -2,6 +2,7 @@ package commands import ( "encoding/json" + "log/slog" "slices" "strings" @@ -155,6 +156,9 @@ func (k Command) Matches(msg tea.KeyPressMsg, leader bool) bool { func parseBindings(bindings ...string) []Keybinding { var parsedBindings []Keybinding for _, binding := range bindings { + if binding == "none" { + continue + } for p := range strings.SplitSeq(binding, ",") { requireLeader := strings.HasPrefix(p, "<leader>") keybinding := strings.ReplaceAll(p, "<leader>", "") @@ -219,7 +223,6 @@ func LoadFromConfig(config *opencode.Config) CommandRegistry { { Name: SessionUnshareCommand, Description: "unshare session", - Keybindings: parseBindings("<leader>u"), Trigger: []string{"unshare"}, }, { @@ -375,15 +378,14 @@ func LoadFromConfig(config *opencode.Config) CommandRegistry { // Remove share/unshare commands if sharing is disabled if config.Share == opencode.ConfigShareDisabled && (command.Name == SessionShareCommand || command.Name == SessionUnshareCommand) { + slog.Info("Removing share/unshare commands") continue } if keybind, ok := keybinds[string(command.Name)]; ok && keybind != "" { - if keybind == "none" { - continue - } command.Keybindings = parseBindings(keybind) } registry[command.Name] = command } + slog.Info("Loaded commands", "commands", registry) return registry } |
