mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-30 03:23:08 +03:00
Add property outputTitle to CustomCommand
It can optionally be used to set the title of the panel that shows the output of a command (when showOutput is true). If left unset, the command string is used as the title.
This commit is contained in:
@ -292,7 +292,15 @@ func (self *HandlerCreator) finalHandler(customCommand config.CustomCommand, ses
|
||||
if strings.TrimSpace(output) == "" {
|
||||
output = self.c.Tr.EmptyOutput
|
||||
}
|
||||
return self.c.Alert(cmdStr, output)
|
||||
|
||||
title := cmdStr
|
||||
if customCommand.OutputTitle != "" {
|
||||
title, err = resolveTemplate(customCommand.OutputTitle)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return self.c.Alert(title, output)
|
||||
}
|
||||
|
||||
return nil
|
||||
|
Reference in New Issue
Block a user