Skip to content

Commit

Permalink
Fix ANSI
Browse files Browse the repository at this point in the history
  • Loading branch information
unKn0wnUser453 authored and unKn0wnUser453 committed Mar 6, 2021
1 parent 7818e36 commit d055a67
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions evil-winrm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ def docker_detection()
def colorize(text, color = "default")
colors = {"default" => "38", "blue" => "34", "red" => "31", "yellow" => "1;33", "magenta" => "35"}
color_code = colors[color]
return "\033[0;#{color_code}m#{text}\033[0m"
return "\001\033[0;#{color_code}m\002#{text}\001\033[0m\002"
end

# Messsage printing
Expand Down Expand Up @@ -456,8 +456,7 @@ def main
until command == "exit" do
pwd = shell.run("(get-location).path").output.strip
if $colors_enabled then
print(self.colorize("*Evil-WinRM*", "red") + self.colorize(" PS ", "yellow") + pwd + "> ")
command = Readline.readline('', true)
command = Readline.readline(self.colorize("*Evil-WinRM*", "red") + self.colorize(" PS ", "yellow") + pwd + "> ", true)
else
command = Readline.readline("*Evil-WinRM* PS " + pwd + "> ", true)
end
Expand Down

0 comments on commit d055a67

Please sign in to comment.