about summary refs log tree commit diff stats
path: root/commands
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2019-07-08 18:32:31 -0400
committerDrew DeVault <sir@cmpwn.com>2019-07-08 18:32:31 -0400
commit133085b436f56bdd48fb1aba1184811b3a278d3c (patch)
tree5f010744ca4bd9e0cf97c6cdad93bf5e7feb8020 /commands
parent6797f9347603aff0831bf56566fbf164cbdda179 (diff)
downloadaerc-133085b436f56bdd48fb1aba1184811b3a278d3c.tar.gz
Fix re-opening of expired pipe tabs
Diffstat (limited to 'commands')
-rw-r--r--commands/exec.go6
-rw-r--r--commands/msg/pipe.go8
2 files changed, 11 insertions, 3 deletions
diff --git a/commands/exec.go b/commands/exec.go
index a46b93a..27edf5d 100644
--- a/commands/exec.go
+++ b/commands/exec.go
@@ -36,10 +36,14 @@ func (_ ExecCmd) Execute(aerc *widgets.Aerc, args []string) error {
 			aerc.PushStatus(" "+err.Error(), 10*time.Second).
 				Color(tcell.ColorDefault, tcell.ColorRed)
 		} else {
+			color := tcell.ColorDefault
+			if cmd.ProcessState.ExitCode() != 0 {
+				color = tcell.ColorRed
+			}
 			aerc.PushStatus(fmt.Sprintf(
 				"%s: completed with status %d", args[0],
 				cmd.ProcessState.ExitCode()), 10*time.Second).
-				Color(tcell.ColorDefault, tcell.ColorDefault)
+				Color(tcell.ColorDefault, color)
 		}
 	}()
 	return nil
diff --git a/commands/msg/pipe.go b/commands/msg/pipe.go
index 158f9ea..6f8c616 100644
--- a/commands/msg/pipe.go
+++ b/commands/msg/pipe.go
@@ -91,10 +91,14 @@ func (_ Pipe) Execute(aerc *widgets.Aerc, args []string) error {
 			aerc.PushStatus(" "+err.Error(), 10*time.Second).
 				Color(tcell.ColorDefault, tcell.ColorRed)
 		} else {
+			color := tcell.ColorDefault
+			if ecmd.ProcessState.ExitCode() != 0 {
+				color = tcell.ColorRed
+			}
 			aerc.PushStatus(fmt.Sprintf(
-				"%s: completed with status %d", args[0],
+				"%s: completed with status %d", cmd[0],
 				ecmd.ProcessState.ExitCode()), 10*time.Second).
-				Color(tcell.ColorDefault, tcell.ColorDefault)
+				Color(tcell.ColorDefault, color)
 		}
 	}