mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-11 04:15:48 +02: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:
parent
6343fb57d6
commit
22a38c9f50
6 changed files with 74 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue