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
Informational prompt? #1163
Comments
First off, thanks for your kind words :) Sounds like we want a |
I'm chucking the good-first-issue label on this because I reckon this will be pretty straightforward to implement. Relevant places that need updating: |
I would like to fix this. I can understand that we can add the showOutput in the CustomCommand to check whether we need to show output in the handleCustomCommandKeybinding. But I am quite newbie so I don't know show to popup the output of the command. Could you please give me the reference of the popup @jesseduffield Thanks |
@dutroctu you would want to go into f := func() error {
cmdStr, err := gui.resolveTemplate(customCommand.Command, promptResponses)
if err != nil {
return gui.surfaceError(err)
}
if customCommand.Subprocess {
return gui.runSubprocessWithSuspenseAndRefresh(gui.OSCommand.PrepareShellSubProcess(cmdStr))
}
loadingText := customCommand.LoadingText
if loadingText == "" {
loadingText = gui.Tr.LcRunningCustomCommandStatus
}
return gui.WithWaitingStatus(loadingText, func() error {
output, err := gui.OSCommand.
WithSpan(gui.Tr.Spans.CustomCommand).
RunShellCommandWithOutput(cmdStr)
if err != nil {
return gui.surfaceError(err)
}
if err := gui.refreshSidePanels(refreshOptions{}); err != nil {
return err
}
if customCommand.ShowOutput {
return gui.ask(askOpts{
title: customCommand.Command,
prompt: output,
})
}
return nil
})
} The Lemme know if you need any help |
Is your feature request related to a problem? Please describe.
In our project we use git describe all the time for issue tracking. I implemented a custom command that sort of does what I want but I'm interested if you have ever thought about informational only prompts. I.e. not 'input' or 'menu', just outputting the result of something like git describe. There may be other use cases for informational prompts but lg is pretty comprehensive and I'm struggling to think of anything else where you haven't covered my bases already.
Describe the solution you'd like
I'd like to have a bound customCommand that pops up the prompt and exits perhaps on Esc or Enter (doesn't matter, whichever makes sense to you).
Describe alternatives you've considered
Here's what I implemented, which works fine but it feels a bit like a context switch:
I can also use the ':' option and type in git describe as an on-the-fly custom command from the localBranches or commits tabs. Also a workable solution but also feels context switchy. And I'd prefer a single command to typing the full command each time.
Additional context
Thanks so much for lg. A few of my colleagues and I love it.
The text was updated successfully, but these errors were encountered: