ShellInput constructor
ShellInput(
- ShellInputSubmit onSubmit, {
- ShellPrompt? prompt,
construct
Implementation
ShellInput(this.onSubmit, {ShellPrompt? prompt}) {
if (prompt == null) {
this.prompt = basicShellPrompt(r'$ ');
} else {
this.prompt = prompt;
}
stdin.echoMode = false;
stdin.lineMode = false;
_handlers = <String, ShellInputSubmit>{
'\x1b\x5b\x43': _handleRightArrow,
'\x1b\x5b\x44': _handleLeftArrow,
'\x1b\x5b\x41': _handleUpArrow,
'\x1b\x5b\x42': _handleDownArrow,
'\x7f': _handleDelete,
'\x09': _handleTab,
'\n': _handleReturn
};
}