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

Get current line text #620

Closed
jiayihu opened this issue Mar 28, 2017 · 1 comment
Closed

Get current line text #620

jiayihu opened this issue Mar 28, 2017 · 1 comment

Comments

@jiayihu
Copy link

jiayihu commented Mar 28, 2017

How can I get the text of the current line (for example when Enter is pressed)? Of course I could keep track of it listening the key event but I'm thinking if there is a better solution.

Great work anyway! 🤘

Details

  • xterm.js version: 2.4.0
@Tyriar
Copy link
Member

Tyriar commented Mar 29, 2017

No easy way to do this right now, and it wouldn't be a reliable method of pulling out the command that was run if that's what you're thinking for the following reasons:

  • Different shells/users have different prompt formats
  • Pressing enter doesn't necessarily mean the line is a command (think random enter presses, applications like vim, opening a " and typing, etc.)

I'm going to close this in favor of #576 which aims to extract more state from the shell.

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

No branches or pull requests

2 participants