fix(tui): allow slash command menu on first line with existing text#1227
Merged
badlogic merged 1 commit intobadlogic:mainfrom Feb 4, 2026
Merged
Conversation
Owner
|
That's on purpose. What's the use case for this? |
Contributor
Author
|
I use a few commands (like handoff or skill) but sometimes forget to start my message. So I go back to the start of the editor to add it, but the completion doesn't trigger I often don't remember from the top of my head the exact name of the command/skill I need to use, just enough for the Right now i end up copying the text, clearing the editor, typing+tab the command and then re-pasting the rest of the message. |
cdd00d4 to
544bf06
Compare
544bf06 to
9920d89
Compare
Owner
|
Looking good, merged! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hello!
Noticed that when trying to prepend a custom command when the editor has multiple line, the slash command completion wouldn't trigger.
Summary by Opus:
Changes
isSlashMenuAllowed()inpackages/tui/src/components/editor.tsfrom checking that all non-cursor lines are empty to simply checkingcursorLine === 0.Before: Typing
/at the beginning of line 0 would not trigger the slash command autocomplete menu if any other line had content. This prevented the workflow of writing text first, then prepending a slash command to use that text as the command's argument.After: The slash command menu triggers on line 0 regardless of content on other lines. It still does not trigger on non-first lines, preserving the fix for #904 (slash menu appearing on arbitrary new lines in multi-line input).
File:
packages/tui/src/components/editor.tsisSlashMenuAllowed(): changed from a loop checking all lines toreturn this.state.cursorLine === 0isAtStartOfMessage()andisInSlashCommandContext()are unchanged but inherit the new behaviorCommands that already accept arguments via
startsWith(/model,/compact,/name,/export) work with trailing text. Commands that use exact match (/settings,/new, etc.) are unaffected since they don't accept arguments.