aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
authorBrooks J Rady <b.j.rady@gmail.com>2021-01-07 09:39:16 +0000
committerBrooks J Rady <b.j.rady@gmail.com>2021-01-07 09:39:16 +0000
commit01eaedcd3746e9de30fe867340667c65d8eb2733 (patch)
treed4a2ce89265d1a38ac8a4041821058336d43d1a6 /src/main.rs
parentMerge branch 'main' into wasm-launchable (diff)
downloadsl0ppij-01eaedcd3746e9de30fe867340667c65d8eb2733.tar.gz
sl0ppij-01eaedcd3746e9de30fe867340667c65d8eb2733.tar.xz
sl0ppij-01eaedcd3746e9de30fe867340667c65d8eb2733.zip
Parse bytes into keys with Termion
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs
index 01d0f232..1cbfac45 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -15,6 +15,7 @@ mod utils;
mod wasm_vm;
+use std::cell::RefCell;
use std::io::Write;
use std::os::unix::net::UnixStream;
use std::path::PathBuf;
@@ -24,6 +25,7 @@ use std::thread;
use panes::PaneId;
use serde::{Deserialize, Serialize};
use structopt::StructOpt;
+use termion::input::TermRead;
use wasm_vm::PluginInstruction;
use crate::command_is_executing::CommandIsExecuting;
@@ -37,7 +39,6 @@ use crate::utils::{
consts::{MOSAIC_IPC_PIPE, MOSAIC_TMP_DIR, MOSAIC_TMP_LOG_DIR},
logging::*,
};
-use std::cell::RefCell;
thread_local!(static OPENCALLS: RefCell<ErrorContext> = RefCell::default());
@@ -462,6 +463,12 @@ pub fn start(mut os_input: Box<dyn OsApi>, opts: Opt) {
buf_tx.send(wasi_stdout(&wasi_env)).unwrap();
}
+ PluginInstruction::Input(pid, input_bytes) => {
+ let (instance, wasi_env) = plugin_map.get(&pid).unwrap();
+
+ let handle_key = instance.exports.get_function("handle_key").unwrap();
+ dbg!(input_bytes.keys().collect::<Vec<_>>());
+ }
PluginInstruction::Quit => break,
i => panic!("Yo, dawg, nice job calling the wasm thread!\n {:?} is defo not implemented yet...", i),
}