elementary shell behavior: can kick off a foreground process and
handle signals
This commit is contained in:
parent
3b1ae0efd5
commit
99cb9e5a2e
17 changed files with 619 additions and 167 deletions
16
src/stl.rs
16
src/stl.rs
|
|
@ -19,7 +19,9 @@ use crate::segment::{Ctr, Seg, Type};
|
|||
use crate::run::{run_callback, RUN_DOCSTRING};
|
||||
use crate::sym::{Args, SymTable, Symbol, ValueType};
|
||||
use std::rc::Rc;
|
||||
use std::cell::RefCell;
|
||||
|
||||
pub mod posix;
|
||||
pub mod append;
|
||||
pub mod boolean;
|
||||
pub mod control;
|
||||
|
|
@ -613,7 +615,7 @@ pub fn static_stdlib(syms: &mut SymTable) -> Result<(), String> {
|
|||
/// dynamic_stdlib
|
||||
/// takes configuration data and uses it to insert dynamic
|
||||
/// callbacks with configuration into a symtable
|
||||
pub fn dynamic_stdlib(syms: &mut SymTable) -> Result<(), String> {
|
||||
pub fn dynamic_stdlib(syms: &mut SymTable, shell: Option<Rc<RefCell<posix::ShellState>>>) -> Result<(), String> {
|
||||
//get CFG_RELISH_ENV from syms
|
||||
let env_cfg_user_form = syms
|
||||
.call_symbol(&"CFG_RELISH_ENV".to_string(), &Seg::new(), true)
|
||||
|
|
@ -637,5 +639,17 @@ pub fn dynamic_stdlib(syms: &mut SymTable) -> Result<(), String> {
|
|||
},
|
||||
);
|
||||
|
||||
if let Some(shell_state) = shell {
|
||||
let posix_cfg_user_form = syms
|
||||
.call_symbol(&"CFG_RELISH_POSIX".to_string(), &Seg::new(), true)
|
||||
.unwrap_or_else(|_: String| Box::new(Ctr::None))
|
||||
.to_string()
|
||||
.eq("true");
|
||||
|
||||
if posix_cfg_user_form {
|
||||
posix::load_posix_shell(syms, shell_state);
|
||||
}
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue