Added 'read_key' builtin that allows widget scripts to handle input

This commit is contained in:
2026-03-03 20:39:09 -05:00
parent 7912f747fd
commit 1f2077af1d
12 changed files with 433 additions and 72 deletions

View File

@@ -9,9 +9,7 @@ use crate::{
libsh::{
error::{ShErr, ShErrKind, ShResult, last_color, next_color},
utils::{NodeVecUtils, TkVecUtils},
},
prelude::*,
procio::IoMode,
}, parse::lex::clean_input, prelude::*, procio::IoMode
};
pub mod execute;
@@ -52,6 +50,11 @@ pub struct ParsedSrc {
impl ParsedSrc {
pub fn new(src: Arc<String>) -> Self {
let src = if src.contains("\\\n") || src.contains('\r') {
Arc::new(clean_input(&src))
} else {
src
};
Self {
src,
name: "<stdin>".into(),