Skip to content

feat: bash-like Tab completion for shell mode (! commands) in CLI TUI#26065

Open
LycanW wants to merge 1 commit intoanomalyco:devfrom
LycanW:dev
Open

feat: bash-like Tab completion for shell mode (! commands) in CLI TUI#26065
LycanW wants to merge 1 commit intoanomalyco:devfrom
LycanW:dev

Conversation

@LycanW
Copy link
Copy Markdown

@LycanW LycanW commented May 6, 2026

Issue for this PR

Closes #7755

Type of change

  • New feature

What does this PR do?

Pressing Tab while typing a ! shell command now triggers bash-like path/file completion. Added a useKeyboard handler in the CLI TUI Prompt component that intercepts Tab before the agent_cycle keybind, runs readdirSync (cross-platform file completion) or compgen -c (command name fallback).

  • Single match → auto-completes (directories get / suffix)
  • Multiple matches → shown in a toast without path prefix
  • Common prefix auto-expansion
  • Works on Linux, macOS, and Windows

How did you verify your code works?

Built and tested locally on Linux Mint. Verified file completion (ls /usr/lls /usr/local/), directory listing, and command name completion.

Screenshots / recordings

N/A (CLI TUI, no UI screenshots applicable)

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label May 6, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

The following comment was made by an LLM, it may be inaccurate:

The search found one related PR:

Related PR:

This PR addresses shell completion features, though it appears to focus on fish shell completions rather than bash-like completion for the CLI TUI's shell mode (! commands). The current PR (#26065) is specifically about Tab completion within the TUI itself, so while related in theme, they target different scopes.

No exact duplicate PRs found addressing the same feature (Tab completion for ! shell commands in CLI TUI).

- Single match auto-completes, directories get / suffix
- Multiple matches shown without path prefix
- Common prefix auto-expansion
- File completion via readdirSync (cross-platform)
- Command name completion via compgen fallback (first word only)
- Works on Linux, macOS, and Windows
@github-actions github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label May 6, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

Thanks for updating your PR! It now meets our contributing guidelines. 👍

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.

[FEATURE] Tab completion support in shell mode (! command)

1 participant