history tweaks

This commit is contained in:
rhpidfyre 2025-01-14 16:17:12 -05:00
parent 41c611c0ca
commit 09a6ad3ae2
3 changed files with 4 additions and 5 deletions

View File

@ -98,7 +98,7 @@ impl Command {
history.add(self.0.as_str()); history.add(self.0.as_str());
child.wait().ok(); child.wait().ok();
} else { } else {
println!("Unknown command: {}", self.0) println!("lambdashell: Unknown command: {}", self.0)
} }
} }

View File

@ -36,9 +36,8 @@ impl History {
.open(history_file.as_path()) .open(history_file.as_path())
.map_or_display(|mut file| { .map_or_display(|mut file| {
let newline_maybe = if fs_history.is_empty() { "" } else { "\n" }; let newline_maybe = if fs_history.is_empty() { "" } else { "\n" };
if let Err(write_err) = file.write_all(format!("{newline_maybe}{}", self.history.join("\n")).as_bytes()) { let formatted = format!("{newline_maybe}{}", self.history.join("\n"));
session::shell_error(write_err); file.write_all(formatted.as_bytes()).unwrap_or_else(session::shell_error)
};
}); });
} }
} }

View File

@ -41,7 +41,7 @@ pub trait ShellGlobal {
} }
impl ShellGlobal for LuauVm { impl ShellGlobal for LuauVm {
fn global_shell(&self, luau_globals: &Table) -> lResult<()> { fn global_shell(&self, luau_globals: &Table) -> lResult<()> {
luau_globals.set("SHELL", Shell(Rc::clone(&self.ps)))?; luau_globals.raw_set("SHELL", Shell(Rc::clone(&self.ps)))?;
Ok(()) Ok(())
} }
} }