Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interactive mode and tab completion #1319

Open
CCRcmcpe opened this issue Jun 16, 2021 · 3 comments
Open

Interactive mode and tab completion #1319

CCRcmcpe opened this issue Jun 16, 2021 · 3 comments
Labels
Area-Completions Related to support for tab completion enhancement New feature or request

Comments

@CCRcmcpe
Copy link

There are some command line programs that are resource intensive to start, most of them provide interactive mode.
My app's interactive mode implementation:

while (true)
{
    Console.Write("> ");
    string? args = Console.ReadLine();
    if (string.IsNullOrWhiteSpace(args))
    {
        Log.Warning("No args entered");
        continue;
    }

    await rootCommand.InvokeAsync(args);
}

But when I try to add tab completion, I get stuck. Currently, there's no public API to acquire suggestions manually and placing them into console. A build-in interactive mode API would be great.

@jonsequitur jonsequitur added enhancement New feature or request Area-Completions Related to support for tab completion labels Jun 16, 2021
@jonsequitur
Copy link
Contributor

An interactive mode would be pretty nice. Making it work well across different kinds of terminals is why we held off on this for now. A better readline implementation would be a good foundation. Related: dotnet/runtime#52374

FWIW, suggestions can be accessed programmatically. You can see examples here:

@CCRcmcpe
Copy link
Author

I didn't notice there is an API, thanks.

@vlada-shubina
Copy link
Member

dotnet new as well as the whole dotnet CLI will be benefit as well from interactive mode.
The related issue: dotnet/templating#3267

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Completions Related to support for tab completion enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants