MouseTerminal is missing methods for activating and suspending mouse input
RawTerminal
has the methods suspend_raw_mode
and activate_raw_mode
for forcing suspending and activating of raw mode, which can be useful in some situations.
In the same situations where suspending and activating raw mode are useful, it's as useful to be able to activate and suspend mouse inputs programmatically (think for example temporarily suspending the current app with the SIGSTOP signal, and resuming it with the SIGCONT signal: it would be great to suspend the mouse input before handling SIGSTOP, and activate the mouse input when handling SIGCONT).
Doing so is simply a matter of adding something like:
impl<W: Write> MouseTerminal<W> {
pub fn activate_mouse_input(&mut self) -> io::Result<()> {
self.term.write_all(ENTER_MOUSE_SEQUENCE.as_bytes())
}
pub fn suspend_mouse_input(&mut self) -> io::Result<()> {
self.term.write_all(EXIT_MOUSE_SEQUENCE.as_bytes())
}
}
in input.rs
.