1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00

CmdRunner now displays ANSI color codes

This commit is contained in:
Chris Cummer
2018-07-18 16:16:28 -07:00
parent 31e77a59ad
commit 6e6d918bfe
25 changed files with 813 additions and 100 deletions

View File

@@ -5,6 +5,7 @@ import (
"os/exec"
"strings"
"github.com/rivo/tview"
"github.com/senorprogrammer/wtf/wtf"
)
@@ -33,7 +34,7 @@ func (widget *Widget) Refresh() {
widget.UpdateRefreshedAt()
widget.execute()
title := wtf.Config.UString("wtf.mods.cmdrunner.title", widget.String())
title := tview.TranslateANSI(wtf.Config.UString("wtf.mods.cmdrunner.title", widget.String()))
widget.View.SetTitle(title)
widget.View.SetText(widget.result)
@@ -46,5 +47,5 @@ func (widget *Widget) String() string {
func (widget *Widget) execute() {
cmd := exec.Command(widget.cmd, widget.args...)
widget.result = wtf.ExecuteCommand(cmd)
widget.result = tview.TranslateANSI(wtf.ExecuteCommand(cmd))
}