-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Slash command autocomplete doesn't trigger for commands starting with . or - #422
Copy link
Copy link
Closed
Description
Problem
Custom slash commands with names starting with . (e.g., .land, .status) don't appear in autocomplete when typing /..
Root Cause
In pi-tui/dist/components/editor.js, the autocomplete continuation only triggers for alphanumeric characters:
else if (/[a-zA-Z0-9]/.test(char)) {
const currentLine = this.state.lines[this.state.cursorLine] || "";
const textBeforeCursor = currentLine.slice(0, this.state.cursorCol);
// Check if we're in a slash command (with or without space for arguments)
if (textBeforeCursor.trimStart().startsWith("/")) {
this.tryTriggerAutocomplete();
}
// ...
}When typing /., the . character doesn't match [a-zA-Z0-9], so autocomplete isn't triggered/updated.
Use Case
Prefixing custom commands with . is useful for:
- Grouping - visually separates project-specific commands from built-in ones
- Sorting -
.sorts before letters, so custom commands appear first in the list - Ergonomics -
/and.are adjacent keys, making/.a fast combo for accessing custom commands
Expected Behavior
Typing /. should show commands whose names start with . (e.g., .land, .rpi, .status).
Suggested Fix
Expand the regex to include common command name characters:
else if (/[a-zA-Z0-9.\-_]/.test(char)) {Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels