add: WriteChars action (#825)
* Behaves like the `Write` action, but one can specify strings themselves instead of their bytecodes. Usage: WriteChars: "cargo make test",
This commit is contained in:
parent
13f3e747e4
commit
d2b81293df
2 changed files with 13 additions and 0 deletions
|
|
@ -50,6 +50,17 @@ fn route_action(
|
||||||
.send_to_screen(ScreenInstruction::WriteCharacter(val, client_id))
|
.send_to_screen(ScreenInstruction::WriteCharacter(val, client_id))
|
||||||
.unwrap();
|
.unwrap();
|
||||||
}
|
}
|
||||||
|
Action::WriteChars(val) => {
|
||||||
|
session
|
||||||
|
.senders
|
||||||
|
.send_to_screen(ScreenInstruction::ClearScroll(client_id))
|
||||||
|
.unwrap();
|
||||||
|
let val = Vec::from(val.as_bytes());
|
||||||
|
session
|
||||||
|
.senders
|
||||||
|
.send_to_screen(ScreenInstruction::WriteCharacter(val, client_id))
|
||||||
|
.unwrap();
|
||||||
|
}
|
||||||
Action::SwitchToMode(mode) => {
|
Action::SwitchToMode(mode) => {
|
||||||
let palette = session.palette;
|
let palette = session.palette;
|
||||||
// TODO: use the palette from the client and remove it from the server os api
|
// TODO: use the palette from the client and remove it from the server os api
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,8 @@ pub enum Action {
|
||||||
Quit,
|
Quit,
|
||||||
/// Write to the terminal.
|
/// Write to the terminal.
|
||||||
Write(Vec<u8>),
|
Write(Vec<u8>),
|
||||||
|
/// Write Characters to the terminal.
|
||||||
|
WriteChars(String),
|
||||||
/// Switch to the specified input mode.
|
/// Switch to the specified input mode.
|
||||||
SwitchToMode(InputMode),
|
SwitchToMode(InputMode),
|
||||||
/// Resize focus pane in specified direction.
|
/// Resize focus pane in specified direction.
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue