Add term support #19
|
@ -72,7 +72,6 @@ fn send_char(
|
|||
![]() Fully addressing NFC vs NFD unicode behavior will open a can of worms that is non-trivial to resolve. Hopefully, most users have keyboards that input a single unicode point instead of base followed by diacritic. Fully addressing NFC vs NFD unicode behavior will open a can of worms that is non-trivial to resolve. Hopefully, most users have keyboards that input a single unicode point instead of base followed by diacritic.
![]() please add more context so we both know what should be implemented here without trying to read all related code please add more context so we both know what should be implemented here without trying to read all related code
![]() .chars basically brakes non-ASCII chars. It means when you try to format path like (only applies if the [.chars](https://doc.rust-lang.org/std/primitive.str.html#method.chars) basically brakes non-ASCII chars. It means when you try to format path like `C:\nová složka\můj nový soubor` (`C:\new folder\my new file` in Czech) then if fails. You should be able to use https://crates.io/crates/unicode-segmentation
(only applies if the `term` can be a user-defined text)
![]() if
if `.chars().count()` is really what you want (see the previous review comment) then you can replace the `if`'s body with something like:
```rust
return Some(process_for_ctrl_char(s[0], has_ctrl))
```
![]() Perhaps you can use methods like is_ascii_alphabetic or is_ascii_lowercase or even is_ascii_control Perhaps you can use methods like [is_ascii_alphabetic](https://doc.rust-lang.org/std/primitive.char.html#method.is_ascii_alphabetic) or [is_ascii_lowercase](https://doc.rust-lang.org/std/primitive.char.html#method.is_ascii_lowercase) or even [is_ascii_control](https://doc.rust-lang.org/std/primitive.char.html#method.is_ascii_control)
![]() Fully addressing NFC vs NFD unicode behavior will open a can of worms that is non-trivial to resolve. Hopefully, most users have keyboards that input a single unicode point instead of base followed by diacritic. Fully addressing NFC vs NFD unicode behavior will open a can of worms that is non-trivial to resolve. Hopefully, most users have keyboards that input a single unicode point instead of base followed by diacritic.
|
||||
Task::start(async move {
|
||||
println!("Sending char: {}", &c);
|
||||
crate::platform::send_char(send_c.to_string()).await;
|
||||
// crate::platform::unload_signal().await;
|
||||
![]() please add more context so we both know what should be implemented here without trying to read all related code please add more context so we both know what should be implemented here without trying to read all related code
![]() .chars basically brakes non-ASCII chars. It means when you try to format path like (only applies if the [.chars](https://doc.rust-lang.org/std/primitive.str.html#method.chars) basically brakes non-ASCII chars. It means when you try to format path like `C:\nová složka\můj nový soubor` (`C:\new folder\my new file` in Czech) then if fails. You should be able to use https://crates.io/crates/unicode-segmentation
(only applies if the `term` can be a user-defined text)
![]() if
if `.chars().count()` is really what you want (see the previous review comment) then you can replace the `if`'s body with something like:
```rust
return Some(process_for_ctrl_char(s[0], has_ctrl))
```
![]() Perhaps you can use methods like is_ascii_alphabetic or is_ascii_lowercase or even is_ascii_control Perhaps you can use methods like [is_ascii_alphabetic](https://doc.rust-lang.org/std/primitive.char.html#method.is_ascii_alphabetic) or [is_ascii_lowercase](https://doc.rust-lang.org/std/primitive.char.html#method.is_ascii_lowercase) or even [is_ascii_control](https://doc.rust-lang.org/std/primitive.char.html#method.is_ascii_control)
![]() Fully addressing NFC vs NFD unicode behavior will open a can of worms that is non-trivial to resolve. Hopefully, most users have keyboards that input a single unicode point instead of base followed by diacritic. Fully addressing NFC vs NFD unicode behavior will open a can of worms that is non-trivial to resolve. Hopefully, most users have keyboards that input a single unicode point instead of base followed by diacritic.
|
||||
println!("Sent char: {}", &c);
|
||||
});
|
||||
}
|
||||
|
|
|||
![]() please add more context so we both know what should be implemented here without trying to read all related code please add more context so we both know what should be implemented here without trying to read all related code
![]() .chars basically brakes non-ASCII chars. It means when you try to format path like (only applies if the [.chars](https://doc.rust-lang.org/std/primitive.str.html#method.chars) basically brakes non-ASCII chars. It means when you try to format path like `C:\nová složka\můj nový soubor` (`C:\new folder\my new file` in Czech) then if fails. You should be able to use https://crates.io/crates/unicode-segmentation
(only applies if the `term` can be a user-defined text)
![]() if
if `.chars().count()` is really what you want (see the previous review comment) then you can replace the `if`'s body with something like:
```rust
return Some(process_for_ctrl_char(s[0], has_ctrl))
```
![]() Perhaps you can use methods like is_ascii_alphabetic or is_ascii_lowercase or even is_ascii_control Perhaps you can use methods like [is_ascii_alphabetic](https://doc.rust-lang.org/std/primitive.char.html#method.is_ascii_alphabetic) or [is_ascii_lowercase](https://doc.rust-lang.org/std/primitive.char.html#method.is_ascii_lowercase) or even [is_ascii_control](https://doc.rust-lang.org/std/primitive.char.html#method.is_ascii_control)
![]() Fully addressing NFC vs NFD unicode behavior will open a can of worms that is non-trivial to resolve. Hopefully, most users have keyboards that input a single unicode point instead of base followed by diacritic. Fully addressing NFC vs NFD unicode behavior will open a can of worms that is non-trivial to resolve. Hopefully, most users have keyboards that input a single unicode point instead of base followed by diacritic.
![]() please add more context so we both know what should be implemented here without trying to read all related code please add more context so we both know what should be implemented here without trying to read all related code
![]() .chars basically brakes non-ASCII chars. It means when you try to format path like (only applies if the [.chars](https://doc.rust-lang.org/std/primitive.str.html#method.chars) basically brakes non-ASCII chars. It means when you try to format path like `C:\nová složka\můj nový soubor` (`C:\new folder\my new file` in Czech) then if fails. You should be able to use https://crates.io/crates/unicode-segmentation
(only applies if the `term` can be a user-defined text)
![]() if
if `.chars().count()` is really what you want (see the previous review comment) then you can replace the `if`'s body with something like:
```rust
return Some(process_for_ctrl_char(s[0], has_ctrl))
```
![]() Perhaps you can use methods like is_ascii_alphabetic or is_ascii_lowercase or even is_ascii_control Perhaps you can use methods like [is_ascii_alphabetic](https://doc.rust-lang.org/std/primitive.char.html#method.is_ascii_alphabetic) or [is_ascii_lowercase](https://doc.rust-lang.org/std/primitive.char.html#method.is_ascii_lowercase) or even [is_ascii_control](https://doc.rust-lang.org/std/primitive.char.html#method.is_ascii_control)
![]() Fully addressing NFC vs NFD unicode behavior will open a can of worms that is non-trivial to resolve. Hopefully, most users have keyboards that input a single unicode point instead of base followed by diacritic. Fully addressing NFC vs NFD unicode behavior will open a can of worms that is non-trivial to resolve. Hopefully, most users have keyboards that input a single unicode point instead of base followed by diacritic.
|
|
@ -38,7 +38,7 @@ pub struct ATerm {
|
|||
|
||||
impl ATerm {
|
||||
pub fn new() -> result::Result<ATerm, std::io::Error> {
|
||||
let (rows, cols) = (21, 158);
|
||||
let (rows, cols) = (21, 90);
|
||||
let id = 1;
|
||||
let pty_config = tty::Options {
|
||||
shell: Some(tty::Shell::new("/bin/bash".to_string(), vec![])),
|
||||
|
|
|
@ -22,6 +22,7 @@ type RemovedDiagramConnectorsCount = usize;
|
|||
type DiagramConnectorPath = String;
|
||||
type DiagramConnectorName = String;
|
||||
type ComponentId = String;
|
||||
use alacritty_terminal::event::Notify;
|
||||
|
||||
mod component_manager;
|
||||
mod aterm;
|
||||
|
@ -154,9 +155,15 @@ async fn unload_signal(signal_ref_index: usize, store: tauri::State<'_, Store>)
|
|||
}
|
||||
|
||||
#[tauri::command(rename_all = "snake_case")]
|
||||
async fn send_char() -> Result<(), ()> {
|
||||
println!("Sending char: {}", "a");
|
||||
Ok(())
|
||||
async fn send_char(c : String) -> Result<(), ()> {
|
||||
// see if length of c is 1
|
||||
if c.len() == 1 {
|
||||
let term = TERM.lock().unwrap();
|
||||
term.tx.notify(c.into_bytes());
|
||||
Ok(())
|
||||
} else {
|
||||
Err(())
|
||||
}
|
||||
}
|
||||
|
||||
#[tauri::command(rename_all = "snake_case")]
|
||||
|
|
please add more context so we both know what should be implemented here without trying to read all related code
.chars basically brakes non-ASCII chars. It means when you try to format path like
C:\nová složka\můj nový soubor
(C:\new folder\my new file
in Czech) then if fails. You should be able to use https://crates.io/crates/unicode-segmentation(only applies if the
term
can be a user-defined text)if
.chars().count()
is really what you want (see the previous review comment) then you can replace theif
's body with something like:Perhaps you can use methods like is_ascii_alphabetic or is_ascii_lowercase or even is_ascii_control