Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
kgrhartlage opened this issue May 19, 2024 · 3 comments · Fixed by #3579
Closed

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

kgrhartlage opened this issue May 19, 2024 · 3 comments · Fixed by #3579
Labels
enhancement New feature or request

Comments

@kgrhartlage
Copy link

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 🤗

@kgrhartlage kgrhartlage added the enhancement New feature or request label May 19, 2024
@stefanhaller
Copy link
Collaborator

stefanhaller commented May 19, 2024

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
Copy link
Author

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
Copy link
Collaborator

No worries. Here's a PR: #3579

stefanhaller added a commit that referenced this issue May 20, 2024
- **PR Description**

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.

Closes #3576.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants