jesseduffield / lazygit

simple terminal UI for git commands
MIT License
52.65k stars 1.84k forks source link

Feature request: Allow defining custom popup title when using `showOutput` #3576

Closed kgrhartlage closed 5 months ago

kgrhartlage commented 5 months ago

Is your feature request related to a problem? Please describe.

When using the showOutput option to display the output of non-trivial commands, the popup title is no longer descriptive in the sense that it's too verbose. Even if one would like to see the full command, this very quickly is no longer possible since it gets cut off. Here is an example:

CleanShot 2024-05-19 at 11 06 29@2x

Describe the solution you'd like

I would like to define a custom title. Static strings would work for my use cases. For the above example I might want to have "Jira Issue Details" as the title.

The schema could support both a "shorthand" boolean value and object configuration like this:

command: 'jira issue view $(printf %s {{.SelectedLocalBranch.Name}} | grep -o "CUB-[0-9]*") --comments 5'
showOutput:
  title: Jira Issue Details

Being able to use templates would be the cherry on the top.

Describe alternatives you've considered

One could extract the command in a script that results in a command with a very short path. That added step is very undesirable for me personally and the result would only be mildly better.

Additional context

Thank you so much creating this wonderful tool and considering my humble request 🤗

stefanhaller commented 5 months ago

Makes sense. I'd just add a separate config outputTitle instead of overloading showOutput like you suggest, but that might be a matter of taste. It would also be trivial to support template fields like {{.SelectedLocalBranch.Name}}, so I'd just throw this in for more flexibility, because why not.

This seems very easy to do, wanna give it a try yourself? (I'd wait for #3565 to be merged first though, you'll get nasty conficts otherwise.)

kgrhartlage commented 5 months ago

Thank you for the fast reply.

This seems very easy to do, wanna give it a try yourself?

Unfortunately I'm not familiar with Go, let alone the project.

stefanhaller commented 5 months ago

No worries. Here's a PR: #3579