diff --git a/markdown/bitburner.autocompletedata.command.md b/markdown/bitburner.autocompletedata.command.md new file mode 100644 index 000000000..c7ee655f8 --- /dev/null +++ b/markdown/bitburner.autocompletedata.command.md @@ -0,0 +1,15 @@ + + +[Home](./index.md) > [bitburner](./bitburner.md) > [AutocompleteData](./bitburner.autocompletedata.md) > [command](./bitburner.autocompletedata.command.md) + +## AutocompleteData.command property + +The raw command string that you have typed until you press \[Tab\] to use the autocomplete feature. + +For example, if you type `[Space]run test.js[Space][Space][Space][Press tab to use autocomplete]`, "command" will contain all space characters (1 space character before "run" and 3 space characters after ".js"). + +**Signature:** + +```typescript +command: string; +``` diff --git a/markdown/bitburner.autocompletedata.md b/markdown/bitburner.autocompletedata.md index d2c4d416e..6c7020276 100644 --- a/markdown/bitburner.autocompletedata.md +++ b/markdown/bitburner.autocompletedata.md @@ -16,6 +16,7 @@ interface AutocompleteData | Property | Modifiers | Type | Description | | --- | --- | --- | --- | +| [command](./bitburner.autocompletedata.command.md) | | string |

The raw command string that you have typed until you press \[Tab\] to use the autocomplete feature.

For example, if you type [Space]run test.js[Space][Space][Space][Press tab to use autocomplete], "command" will contain all space characters (1 space character before "run" and 3 space characters after ".js").

| | [enums](./bitburner.autocompletedata.enums.md) | | [NSEnums](./bitburner.nsenums.md) | Netscript Enums | | [filename](./bitburner.autocompletedata.filename.md) | | string | The filename of the script about to be run | | [hostname](./bitburner.autocompletedata.hostname.md) | | string | The hostname of the server the script would be running on | diff --git a/src/ScriptEditor/NetscriptDefinitions.d.ts b/src/ScriptEditor/NetscriptDefinitions.d.ts index c8e33f392..9c09bdced 100644 --- a/src/ScriptEditor/NetscriptDefinitions.d.ts +++ b/src/ScriptEditor/NetscriptDefinitions.d.ts @@ -9671,6 +9671,13 @@ interface AutocompleteData { filename: string; /** The processes running on the host */ processes: ProcessInfo[]; + /** + * The raw command string that you have typed until you press [Tab] to use the autocomplete feature. + * + * For example, if you type `[Space]run test.js[Space][Space][Space][Press tab to use autocomplete]`, "command" will + * contain all space characters (1 space character before "run" and 3 space characters after ".js"). + */ + command: string; } /** diff --git a/src/Terminal/getTabCompletionPossibilities.ts b/src/Terminal/getTabCompletionPossibilities.ts index 7c80f39f2..9815750dc 100644 --- a/src/Terminal/getTabCompletionPossibilities.ts +++ b/src/Terminal/getTabCompletionPossibilities.ts @@ -324,6 +324,7 @@ export async function getTabCompletionPossibilities(terminalText: string, baseDi temporary: r.temporary, })), ).flat(), + command: terminalText, }; let pos: string[] = []; let pos2: string[] = [];