From 58f1e48cd2f5843969d43a2d50a0c6a39ca04f31 Mon Sep 17 00:00:00 2001 From: Sami Samhuri Date: Fri, 21 Jan 2022 17:43:04 -0800 Subject: [PATCH] [ruby] Implement clear and actually use builtin pwd instead of /bin/pwd --- ruby/shell/builtins.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ruby/shell/builtins.rb b/ruby/shell/builtins.rb index 6c57d80..6c7749f 100644 --- a/ruby/shell/builtins.rb +++ b/ruby/shell/builtins.rb @@ -66,9 +66,14 @@ module Shell 0 end - def bulitin_pwd(_args) + def builtin_pwd(_args) puts Dir.pwd 0 end + + def builtin_clear(_args) + print "\033[2J" + 0 + end end end