Add term support #19
|
@ -194,7 +194,8 @@ fn root() -> impl Element {
|
|||
match term_open {
|
||||
true =>
|
||||
El::new()
|
||||
.s(Height::fill().max(450))
|
||||
.s(Height::fill().max(400).min(400))
|
||||
.s(Padding::all(5))
|
||||
.child(term::root()),
|
||||
false =>
|
||||
El::new()
|
||||
|
|
|
@ -8,6 +8,8 @@ use shared::term::{TerminalDownMsg, TerminalScreen, TerminalUpMsg};
|
|||
![]() 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.
|
||||
// use tokio::time::timeout;
|
||||
pub static TERM_OPEN: Lazy<Mutable<bool>> = Lazy::new(|| {false.into()});
|
||||
|
||||
pub const TERMINAL_COLOR: Oklch = color!("oklch(20% 0.125 262.26)");
|
||||
![]() 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.
|
||||
pub static TERMINAL_STATE: Lazy<Mutable<TerminalDownMsg>> =
|
||||
Lazy::new(|| {
|
||||
Mutable::new(TerminalDownMsg::TermNotStarted)
|
||||
|
@ -19,6 +21,8 @@ pub fn root() -> impl Element {
|
|||
![]() 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.
|
||||
El::new()
|
||||
.s(Width::fill())
|
||||
.s(Height::fill())
|
||||
.s(Background::new().color(TERMINAL_COLOR))
|
||||
![]() 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.
|
||||
.s(RoundedCorners::all(7))
|
||||
![]() 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.
|
||||
.s(Font::new().family([
|
||||
FontFamily::new("Lucida Console"),
|
||||
FontFamily::new("Courier"),
|
||||
|
@ -66,16 +70,13 @@ fn send_char(
|
|||
![]() 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.
|
||||
has_control : bool,
|
||||
) {
|
||||
match process_str(s, has_control) {
|
||||
// TODO : fill this out
|
||||
![]() 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.
|
||||
Some(c) => {
|
||||
let send_c = c.clone();
|
||||
Task::start(async move {
|
||||
println!("Sending 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.
|
||||
crate::platform::send_char(send_c.to_string()).await;
|
||||
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.
|
||||
});
|
||||
}
|
||||
None => {eprintln!("Not processing: {}", s)}
|
||||
![]() 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.
|
||||
None => {}
|
||||
![]() 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.
![]() 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.
|
|
@ -23,8 +23,8 @@ impl EventListener for EventProxy {
|
|||
pub struct ATerm {
|
||||
pub term: Arc<FairMutex<Term<EventProxy>>>,
|
||||
|
||||
rows : u16,
|
||||
cols : u16,
|
||||
pub rows : u16,
|
||||
pub cols : u16,
|
||||
|
||||
/// Use tx to write things to terminal instance from outside world
|
||||
pub tx: Notifier,
|
||||
|
@ -38,7 +38,7 @@ pub struct ATerm {
|
|||
|
||||
impl ATerm {
|
||||
pub fn new() -> result::Result<ATerm, std::io::Error> {
|
||||
let (rows, cols) = (21, 90);
|
||||
let (rows, cols) = (21, 85);
|
||||
let id = 1;
|
||||
let pty_config = tty::Options {
|
||||
shell: Some(tty::Shell::new("/bin/bash".to_string(), vec![])),
|
||||
|
@ -93,7 +93,7 @@ impl ATerm {
|
|||
}
|
||||
}
|
||||
|
||||
fn terminal_instance_to_string(terminal_instance: &ATerm) -> String {
|
||||
pub fn terminal_instance_to_string(terminal_instance: &ATerm) -> String {
|
||||
let (rows, cols) = (terminal_instance.rows, terminal_instance.cols);
|
||||
let term = terminal_instance.term.lock();
|
||||
let grid = term.grid().clone();
|
||||
|
|
|
@ -23,6 +23,7 @@ type DiagramConnectorPath = String;
|
|||
type DiagramConnectorName = String;
|
||||
type ComponentId = String;
|
||||
use alacritty_terminal::event::Notify;
|
||||
use shared::term::{TerminalDownMsg, TerminalScreen};
|
||||
|
||||
mod component_manager;
|
||||
mod aterm;
|
||||
|
@ -156,7 +157,6 @@ async fn unload_signal(signal_ref_index: usize, store: tauri::State<'_, Store>)
|
|||
|
||||
#[tauri::command(rename_all = "snake_case")]
|
||||
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());
|
||||
|
@ -315,12 +315,20 @@ pub fn run() {
|
|||
|
||||
std::thread::spawn(move || {
|
||||
// Simulate emitting a message after a delay
|
||||
std::thread::sleep(std::time::Duration::from_secs(5));
|
||||
std::thread::sleep(std::time::Duration::from_secs(1));
|
||||
|
||||
// Use APP_HANDLE to emit the event
|
||||
if let Some(app_handle) = APP_HANDLE.read().unwrap().clone() {
|
||||
let payload = serde_json::json!({ "message": "Hello from the backend using APP_HANDLE!" });
|
||||
app_handle.emit("backend-message", payload).unwrap();
|
||||
//tart term and send initial update to backend
|
||||
if let Some(app_handle) = crate::APP_HANDLE.read().unwrap().clone() {
|
||||
let term = crate::TERM.lock().unwrap();
|
||||
let content = crate::aterm::terminal_instance_to_string(&term);
|
||||
let payload = TerminalScreen {
|
||||
cols: term.cols,
|
||||
rows: term.rows,
|
||||
content: content
|
||||
};
|
||||
let payload = TerminalDownMsg::FullTermUpdate(payload);
|
||||
let payload = serde_json::json!(payload);
|
||||
app_handle.emit("term_content", payload).unwrap();
|
||||
}
|
||||
});
|
||||
|
||||
|
|
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