1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Erase only on tty

This commit is contained in:
Nobuyoshi Nakada 2019-07-29 23:04:04 +09:00
parent e62a60927e
commit c2428b8bf6
No known key found for this signature in database
GPG key ID: 4BC7D6DF58D8DF60

View file

@ -171,8 +171,8 @@ End
end end
def erase(e = true) def erase(e = true)
if e and @columns > 0 and !@verbose if e and @columns > 0 and @tty and !@verbose
"\r#{" "*@columns}\r" "\e[1K\r"
else else
"" ""
end end