From 6f9dad48ab99774af0d62c0289ae77144e023cba Mon Sep 17 00:00:00 2001 From: Yorick Peterse Date: Fri, 25 May 2012 16:49:50 +0200 Subject: [PATCH] Clear the current line before starting Pry. This should fix #566. Signed-off-by: Yorick Peterse --- lib/pry/pry_class.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/pry/pry_class.rb b/lib/pry/pry_class.rb index a00ee71f..1ba52a04 100644 --- a/lib/pry/pry_class.rb +++ b/lib/pry/pry_class.rb @@ -132,6 +132,14 @@ class Pry head = target end + # Clear the line before starting Pry. This fixes the issue discussed here: + # https://github.com/pry/pry/issues/566 + if defined?(Win32::Console) + puts "\e[0F" + else + puts "\e[0A\e[0G" + end + # Enter the matrix pry_instance.repl(head) end