xterm.dart
xterm.dart copied to clipboard
TerminalView.onTapUp not being called
What I want to achieve is to get the current selected text on TerminalView
, and I set a onTapUp
callback which never been fired.
TerminalView(
terminal,
theme: draculaTheme,
keyboardType: TextInputType.text,
autofocus: true,
controller: _terminalController,
onTapUp: _onTapUp,
)
Thanks for the great library!
How do you get the currently selected text? I can't find the relevant api
@git-xiaomy try this:
String? get terminalSelected {
final range = _terminalController.selection;
if (range == null) {
return null;
}
return terminal.buffer.getText(range);
}