basic terminal functionality works
This commit is contained in:
parent
e08c673e86
commit
4fd4b6eb17
|
@ -72,7 +72,6 @@ fn send_char(
|
||||||
Task::start(async move {
|
Task::start(async move {
|
||||||
println!("Sending char: {}", &c);
|
println!("Sending char: {}", &c);
|
||||||
crate::platform::send_char(send_c.to_string()).await;
|
crate::platform::send_char(send_c.to_string()).await;
|
||||||
// crate::platform::unload_signal().await;
|
|
||||||
println!("Sent char: {}", &c);
|
println!("Sent char: {}", &c);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,7 +38,7 @@ pub struct ATerm {
|
||||||
|
|
||||||
impl ATerm {
|
impl ATerm {
|
||||||
pub fn new() -> result::Result<ATerm, std::io::Error> {
|
pub fn new() -> result::Result<ATerm, std::io::Error> {
|
||||||
let (rows, cols) = (21, 158);
|
let (rows, cols) = (21, 90);
|
||||||
let id = 1;
|
let id = 1;
|
||||||
let pty_config = tty::Options {
|
let pty_config = tty::Options {
|
||||||
shell: Some(tty::Shell::new("/bin/bash".to_string(), vec![])),
|
shell: Some(tty::Shell::new("/bin/bash".to_string(), vec![])),
|
||||||
|
|
|
@ -22,6 +22,7 @@ type RemovedDiagramConnectorsCount = usize;
|
||||||
type DiagramConnectorPath = String;
|
type DiagramConnectorPath = String;
|
||||||
type DiagramConnectorName = String;
|
type DiagramConnectorName = String;
|
||||||
type ComponentId = String;
|
type ComponentId = String;
|
||||||
|
use alacritty_terminal::event::Notify;
|
||||||
|
|
||||||
mod component_manager;
|
mod component_manager;
|
||||||
mod aterm;
|
mod aterm;
|
||||||
|
@ -154,9 +155,15 @@ async fn unload_signal(signal_ref_index: usize, store: tauri::State<'_, Store>)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tauri::command(rename_all = "snake_case")]
|
#[tauri::command(rename_all = "snake_case")]
|
||||||
async fn send_char() -> Result<(), ()> {
|
async fn send_char(c : String) -> Result<(), ()> {
|
||||||
println!("Sending char: {}", "a");
|
// see if length of c is 1
|
||||||
|
if c.len() == 1 {
|
||||||
|
let term = TERM.lock().unwrap();
|
||||||
|
term.tx.notify(c.into_bytes());
|
||||||
Ok(())
|
Ok(())
|
||||||
|
} else {
|
||||||
|
Err(())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tauri::command(rename_all = "snake_case")]
|
#[tauri::command(rename_all = "snake_case")]
|
||||||
|
|
Loading…
Reference in a new issue