mirror of
https://github.com/bettercap/bettercap
synced 2025-07-07 13:32:07 -07:00
refact: refactored to use islazy and updated deps
This commit is contained in:
parent
a2b3ee79fb
commit
d070445225
238 changed files with 12662 additions and 1586 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue