wow it's actually a shell now

parse-tree
Jordan Orelli 2 years ago
parent e2455594f4
commit d2066e8526

@ -14,13 +14,24 @@ impl Prompt {
} }
pub fn print(&self) -> Result<()> { pub fn print(&self) -> Result<()> {
unsafe { match std::env::current_dir() {
Error::check(Console::WriteConsoleA( Ok(d) => unsafe {
stdout_handle()?, let text = d.to_str().unwrap().to_owned() + " " + &self.s;
self.s.as_bytes(), Error::check(Console::WriteConsoleA(
None, stdout_handle()?,
None, text.as_bytes(),
))?; None,
None,
))?;
}
Err(_) => unsafe {
Error::check(Console::WriteConsoleA(
stdout_handle()?,
self.s.as_bytes(),
None,
None,
))?;
},
} }
Ok(()) Ok(())
} }

Loading…
Cancel
Save