KetraTerm
API · v0.2.2All versions

requestShellSuggestions

fun requestShellSuggestions(commandText: String, cursorOffset: Int, anchorColumn: Int, anchorRow: Int)

Requests shell suggestions from SwingHostServices.shellSuggestionProvider and shows the returned suggestions near a terminal-grid cell.

The component replaces its one completion coroutine for every request, so suspending providers run outside the Swing Event Dispatch Thread and are cancelled when newer input arrives or the popup is hidden. This automatic request is ignored when SwingSettings.smartSuggestionsEnabled or SwingSettings.shellSuggestionsEnabled is false. Empty provider results hide the current popup.

Parameters

commandText

visible command-line text known to the host.

cursorOffset

UTF-16 cursor offset within commandText.

anchorColumn

visible terminal-grid column used as the popup anchor.

anchorRow

visible terminal-grid row used as the popup anchor.