Skip to content

ITerm2-like terminal autocomplete #6632

@isotes

Description

@isotes

Description of the new feature/enhancement

Provide autocomplete by the terminal (not the shell) based on previous output (comparable to the iTerm2 'Autocomplete' feature described here).

inShell

This feature does not require any knowledge about the current command but works just by inspecting the existing output as shown by the terminal. It uses the word currently being typed (based on the output and the cursor position) to provide autocompletion proposals. Therefore, it is independent of the shell and works also for other console applications that allow input, e.g., editors.

inNano

A request for this feature has been mentioned here but I don't think it has been recognised as a different feature from the issue it was mentioned in.

Proposed technical implementation details

A possible approach could be based on a set of characters that separate words. First, identify the currently typed word by going backward from the cursor to the first non-word character. Second, perform a backwards search for words with the same prefix (and stop after a certain number of proposals or amount of text searched to ensure quick and helpful feedback).

Note that in the iTerm2 implementation 'word' encompasses a whole path, i.e., both / and \ are treated as a word character, which I found very helpful.

[edited to highlight treatment of paths]

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-ExtensibilityA feature that would ideally be fulfilled by us having an extension model.Area-TerminalControlIssues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.)Issue-FeatureComplex enough to require an in depth planning process and actual budgeted, scheduled work.Product-TerminalThe new Windows Terminal.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions