aboutsummaryrefslogtreecommitdiffstats
path: root/src/run
diff options
context:
space:
mode:
authorJonas Maier <jonas@x77.dev>2026-05-09 21:40:11 +0200
committerJonas Maier <jonas@x77.dev>2026-05-09 21:40:11 +0200
commitf467e09038fe675ccd3e2c10b39d94bd5c8e1087 (patch)
tree95fd25ba93bbed36583ff5963d28c700f3bf41e4 /src/run
parent97d8fd2981eb00d26fcbc6ce35a815f45f284649 (diff)
downloadpish-f467e09038fe675ccd3e2c10b39d94bd5c8e1087.tar.gz
icon
Diffstat (limited to 'src/run')
-rw-r--r--src/run/builtin.rs22
-rw-r--r--src/run/mod.rs1
2 files changed, 22 insertions, 1 deletions
diff --git a/src/run/builtin.rs b/src/run/builtin.rs
index bd82e27..9f3ff62 100644
--- a/src/run/builtin.rs
+++ b/src/run/builtin.rs
@@ -839,7 +839,7 @@ impl Builtin for ct {
b"screen_clear" => {
drop(se);
Session::screen_clear(session);
- },
+ }
b"history_previous" => se.history_up(),
b"history_next" => se.history_down(),
b"prompt_del_left" => se.del_left(),
@@ -945,3 +945,23 @@ impl Builtin for Here {
Ok(())
}
}
+
+#[derive(Copy, Clone)]
+pub struct logo;
+
+impl Builtin for logo {
+ fn name(&self) -> &str {
+ "logo"
+ }
+
+ fn io(
+ &self,
+ _session: Arc<Mutex<Session>>,
+ _args: &[BString],
+ _stdin: &mut dyn Read,
+ stdout: &mut dyn Write,
+ ) -> Result {
+ stdout.write_all(&crate::icon())?;
+ Ok(())
+ }
+}
diff --git a/src/run/mod.rs b/src/run/mod.rs
index ddac394..a5fd69a 100644
--- a/src/run/mod.rs
+++ b/src/run/mod.rs
@@ -710,6 +710,7 @@ const BUILTINS: &[&'static dyn BuiltinClone] = &[
&builtin::Break,
&builtin::Continue,
&builtin::Here,
+ &builtin::logo,
];
pub fn builtin_map() -> HashMap<BString, &'static dyn BuiltinClone> {