Skip to content

fix: Slash Command Autocomplete vs. Auto-Execute Fix (#2257)#2275

Open
yunus25jmi1 wants to merge 1 commit intodocker:mainfrom
yunus25jmi1:feature/slash-command-autocomplete-fix
Open

fix: Slash Command Autocomplete vs. Auto-Execute Fix (#2257)#2275
yunus25jmi1 wants to merge 1 commit intodocker:mainfrom
yunus25jmi1:feature/slash-command-autocomplete-fix

Conversation

@yunus25jmi1
Copy link
Copy Markdown
Contributor

I have successfully implemented a root-cause fix for the issue where pressing Tab to autocomplete a slash command would immediately execute it instead of just completing the text.

Root Cause Analysis:
In pkg/tui/components/completion/completion.go, both Enter and Tab were bound to the same key binding, causing auto-submit completions (like slash commands) to execute immediately upon selection with either key.

Solution Implemented:

  • Separate Tab and Enter key bindings in completion.go.
  • Tab now autocompletes text only (AutoExecute=false).
  • Enter executes the command (AutoExecute=true).
  • Updated editor.go to handle the AutoExecute flag.
  • Added comprehensive tests in pkg/tui/components/completion/autocomplete_test.go.

Verification:

  • pkg/tui/components/completion tests: 6/6 PASS
  • pkg/tui/components/editor tests: PASS
  • Successful build of project and binary

Fixes #2257

@yunus25jmi1 yunus25jmi1 requested a review from a team as a code owner March 29, 2026 07:56
I have successfully implemented a root-cause fix for the issue where pressing Tab to autocomplete a slash command would immediately execute it instead of just completing the text.

Root Cause Analysis:
In pkg/tui/components/completion/completion.go, both Enter and Tab were bound to the same key binding, causing auto-submit completions (like slash commands) to execute immediately upon selection with either key.

Solution Implemented:
- Separate Tab and Enter key bindings in completion.go.
- Tab now autocompletes text only (AutoExecute=false).
- Enter executes the command (AutoExecute=true).
- Updated editor.go to handle the AutoExecute flag.
- Added comprehensive tests in pkg/tui/components/completion/autocomplete_test.go.

Verification:
- pkg/tui/components/completion tests: 6/6 PASS
- pkg/tui/components/editor tests: PASS
- Successful build of project and binary

Fixes docker#2257
@yunus25jmi1 yunus25jmi1 force-pushed the feature/slash-command-autocomplete-fix branch from a5614de to 68994bd Compare March 29, 2026 08:01
@k33g
Copy link
Copy Markdown
Contributor

k33g commented Apr 1, 2026

@yunus25jmi1 does it fix the the call of a skill with a slash command (#1819)?

@yunus25jmi1
Copy link
Copy Markdown
Contributor Author

@yunus25jmi1 does it fix the the call of a skill with a slash command (#1819)?

Yes, this is going to resolve the Issue #1819

@yunus25jmi1 yunus25jmi1 force-pushed the feature/slash-command-autocomplete-fix branch from c7a7fd8 to 0030b96 Compare April 4, 2026 16:45
@yunus25jmi1 yunus25jmi1 force-pushed the feature/slash-command-autocomplete-fix branch from 0030b96 to 68994bd Compare April 4, 2026 17:58
@yunus25jmi1
Copy link
Copy Markdown
Contributor Author

Hi @dgageot, could you please review this PR? This is a focused fix for the slash command autocomplete issue (#2257) that also resolves #1819. The PR now contains only 1 commit with the fix. Tests pass locally and the project builds successfully. Thank you!

@yunus25jmi1
Copy link
Copy Markdown
Contributor Author

Hi @dgageot and maintainers, I noticed that PR #2325 by @joshbarrington also addresses issues #2257 and #1819 with a different implementation approach. This PR takes a simpler route by removing AutoComplete from the command interface and driving behavior directly through the Update function.

Since both PRs aim to fix the same issues, could you please clarify which direction you'd prefer to proceed with? I'm happy to close #2275 in favor of #2325 if that's the preferred approach, or I can update my PR if needed. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[enhancement] Slash Command auto complete vs. auto execute

2 participants