mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-10-09 15:58:34 +00:00
22 lines
494 B
TypeScript
22 lines
494 B
TypeScript
type StringRef = {
|
|
current: string;
|
|
};
|
|
|
|
type InterruptInputStateOptions = {
|
|
commandBufferRef: StringRef;
|
|
serialLineBufferRef?: StringRef;
|
|
onAutocompleteInput?: (data: string) => void;
|
|
};
|
|
|
|
export function clearTerminalInputStateForInterrupt({
|
|
commandBufferRef,
|
|
serialLineBufferRef,
|
|
onAutocompleteInput,
|
|
}: InterruptInputStateOptions): void {
|
|
commandBufferRef.current = "";
|
|
if (serialLineBufferRef) {
|
|
serialLineBufferRef.current = "";
|
|
}
|
|
onAutocompleteInput?.("\x03");
|
|
}
|