ShellCompleter
Category: Shell
Source: shell_completer.dart
Enums
ShellType
The type of shell detected on the system.
| Value | Description |
|---|---|
bash | |
fish | |
zsh | |
sh |
Classes
ShellCandidate
A single completion candidate from the shell.
Constructor
dart
ShellCandidate(this.text, {this.description, this.isDirectory = false})Properties
| Property | Type | Description |
|---|---|---|
text | String | |
description | String? | |
isDirectory | bool |
ShellCompleter
Spawns shell subprocesses to produce tab-completion candidates.
Uses compgen for bash/zsh/sh and complete -C for fish. Results are cached with a short TTL to avoid repeated subprocess spawns.
Constructor
dart
ShellCompleter({ShellType? shellType})Properties
| Property | Type | Description |
|---|---|---|
shellType | ShellType |
Methods
int tokenStart(String buffer)
Extract the start position of the completable token.
Given "git checkout --fo", returns the index of "--fo" (15). Given "ls", returns 0. Given "cat ", returns 4 (empty token at end).
Future<List<ShellCandidate>> complete(String buffer)
Get completions for the given command line buffer.