refact: refactored to use islazy and updated deps

This commit is contained in:
evilsocket 2018-10-10 19:00:25 +02:00
parent a2b3ee79fb
commit d070445225
238 changed files with 12662 additions and 1586 deletions

View file

@ -4,7 +4,7 @@ import (
"fmt"
"strings"
"github.com/bettercap/bettercap/core"
"github.com/evilsocket/islazy/tui"
"github.com/dustin/go-humanize"
)
@ -16,22 +16,22 @@ const (
var (
// these are here because if colors are disabled,
// we need the updated core.* variables
// we need the updated tui.* variables
effects = map[string]string{
"{bold}": core.BOLD,
"{dim}": core.DIM,
"{r}": core.RED,
"{g}": core.GREEN,
"{b}": core.BLUE,
"{y}": core.YELLOW,
"{fb}": core.FG_BLACK,
"{fw}": core.FG_WHITE,
"{bdg}": core.BG_DGRAY,
"{br}": core.BG_RED,
"{bg}": core.BG_GREEN,
"{by}": core.BG_YELLOW,
"{blb}": core.BG_LBLUE, // Ziggy this is for you <3
"{reset}": core.RESET,
"{bold}": tui.BOLD,
"{dim}": tui.DIM,
"{r}": tui.RED,
"{g}": tui.GREEN,
"{b}": tui.BLUE,
"{y}": tui.YELLOW,
"{fb}": tui.FOREBLACK,
"{fw}": tui.FOREWHITE,
"{bdg}": tui.BACKDARKGRAY,
"{br}": tui.BACKRED,
"{bg}": tui.BACKGREEN,
"{by}": tui.BACKYELLOW,
"{blb}": tui.BACKLIGHTBLUE, // Ziggy this is for you <3
"{reset}": tui.RESET,
}
PromptCallbacks = map[string]func(s *Session) string{
"{cidr}": func(s *Session) string {
@ -80,8 +80,8 @@ func (p Prompt) Render(s *Session) string {
}
// make sure an user error does not screw all terminal
if !strings.HasPrefix(prompt, core.RESET) {
prompt += core.RESET
if !strings.HasPrefix(prompt, tui.RESET) {
prompt += tui.RESET
}
return prompt