Skip to content

Commit

Permalink
add --no-colors flag #46
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Kramarev authored and akavel committed Mar 3, 2020
1 parent e8ddd78 commit eaae039
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions up.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ var (
unsafeMode = pflag.Bool("unsafe-full-throttle", false, "enable mode in which command is executed immediately after any change")
outputScript = pflag.StringP("output-script", "o", "", "save the command to specified `file` if Ctrl-X is pressed (default: up<N>.sh)")
debugMode = pflag.Bool("debug", false, "debug mode")
noColors = pflag.Bool("no-colors", false, "disable interface colors")
)

func main() {
Expand Down Expand Up @@ -783,6 +784,9 @@ func TuiRegion(tui tcell.Screen, x, y, w, h int) Region {
W: w, H: h,
SetCell: func(dx, dy int, style tcell.Style, ch rune) {
if dx >= 0 && dx < w && dy >= 0 && dy < h {
if *noColors {
style = tcell.StyleDefault
}
tui.SetCell(x+dx, y+dy, style, ch)
}
},
Expand Down

0 comments on commit eaae039

Please sign in to comment.