diff --git a/pkg/config/user_config.go b/pkg/config/user_config.go index 59bfcc042..804a5bee0 100644 --- a/pkg/config/user_config.go +++ b/pkg/config/user_config.go @@ -310,6 +310,7 @@ type CustomCommand struct { LoadingText string `yaml:"loadingText"` Description string `yaml:"description"` Stream bool `yaml:"stream"` + ShowOutput bool `yaml:"showOutput"` } type CustomCommandPrompt struct { diff --git a/pkg/gui/services/custom_commands/handler_creator.go b/pkg/gui/services/custom_commands/handler_creator.go index 3dd9a0517..b5c2b9efd 100644 --- a/pkg/gui/services/custom_commands/handler_creator.go +++ b/pkg/gui/services/custom_commands/handler_creator.go @@ -187,10 +187,13 @@ func (self *HandlerCreator) finalHandler(customCommand config.CustomCommand, ses if customCommand.Stream { cmdObj.StreamOutput() } - err := cmdObj.Run() + output, err := cmdObj.RunWithOutput() if err != nil { return self.c.Error(err) } + if customCommand.ShowOutput { + return self.c.Alert(cmdStr, output) + } return self.c.Refresh(types.RefreshOptions{}) }) }