-
Notifications
You must be signed in to change notification settings - Fork 2
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
Emitting mouse sequences? #21
Comments
Thanks for the issue. To answer your question, it really depends on how we're looking at the
I wrote this crate for the first use case and it doesn't make much sense to add support for this. It's also a bit complicated, see below. There's no single ANSI escape sequence type for mouse events. We have:
Let's say we will implement Which variant should we emit? X10 compatibility mode? Xterm mode? Rxvt mode? Add special method just for the mouse to emit correct variant? We can introduce another enum like: enum Mouse {
Xterm(...),
X10(...),
Rxvt(...),
} Then we will know what to emit, but we will complicate it for the There's one thing you can do to forward mouse events. Skip the impl Provider for MyType {
fn provide_csi_sequence(&mut self, parameters: &[u64], ignored_count: usize, ch: char) {
if ch == 'm' || ch == 'M' {
// Mouse event - reconstruct ANSI sequence & forward it
} else {
// Not a mouse event
}
}
} Not sure if I helped you. Thoughts? |
I think this makes sense. Thanks. The changes you floated will probably be helpful if they do come in a release, but I can make do without as well. |
@eaglgenes101 so for now, I'd recommend to copy & paste |
Understandably, emitting escape sequences to generate terminal mouse sequences is rather niche, but is it within the scope of this project? I'm thinking of using it as part of a terminal multiplexer for forwarding mouse events to pseudoterminals.
The text was updated successfully, but these errors were encountered: