Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TerminalView.onTapUp not being called #178

Open
maxhis opened this issue Jul 9, 2023 · 3 comments
Open

TerminalView.onTapUp not being called #178

maxhis opened this issue Jul 9, 2023 · 3 comments

Comments

@maxhis
Copy link

maxhis commented Jul 9, 2023

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!

@git-xiaomy
Copy link

git-xiaomy commented Aug 16, 2023

How do you get the currently selected text? I can't find the relevant api

@maxhis
Copy link
Author

maxhis commented Aug 21, 2023

@git-xiaomy try this:

  String? get terminalSelected {
    final range = _terminalController.selection;
    if (range == null) {
      return null;
    }
    return terminal.buffer.getText(range);
  }

@dayeguilaiye
Copy link

@maxhis Did you finally fixed this? I found the same problem, do you have any walkaround?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants