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

responding to SIGINT #1

Open
euneuber opened this issue Nov 25, 2021 · 8 comments
Open

responding to SIGINT #1

euneuber opened this issue Nov 25, 2021 · 8 comments
Labels

Comments

@euneuber
Copy link

Thanks for this great tool!

I'd like to make a small suggestion:

  • on [Ctrl]-C (SIGINT) an exit code of 128 + signal number = 130 should be returned (see man 1 bash in "SHELL GRAMMAR" / "Simple Commands" for reference)
  • on [Ctrl]-C (SIGINT) do not put any ouput on terminal.
@pbek pbek added the support label Nov 25, 2021
@pbek
Copy link
Member

pbek commented Nov 25, 2021

Thank you for your kind words (and the first like). 😁

What are we talking about? What do you want to quit with Ctrl + C? fzf?

@euneuber
Copy link
Author

Yes, qc starts fzf so SIGINT terminates fzf and it already responds with exit code 130 (one can start fzf alone in a terminal and press [Ctrl]-C followed by echo $?)

@pbek
Copy link
Member

pbek commented Nov 27, 2021

And you want that this exit code is passed through by qc when exiting?

@pbek
Copy link
Member

pbek commented Nov 27, 2021

And what do you want to achieve by this?

@pbek
Copy link
Member

pbek commented Nov 27, 2021

It should already be returned by:

qc/cmd/exec.go

Line 41 in 9cb2c1c

return run(command, os.Stdin, os.Stdout)

But it doesn't seem to be returned by Cobra:

qc/cmd/exec.go

Lines 14 to 20 in 9cb2c1c

// execCmd represents the exec command
var execCmd = &cobra.Command{
Use: "exec",
Short: "Run the selected commands",
Long: `Run the selected commands directly`,
RunE: execute,
}

@pbek
Copy link
Member

pbek commented Nov 27, 2021

You can play around with it if you like...

@euneuber
Copy link
Author

euneuber commented Dec 2, 2021

Yes, qc starts fzf so SIGINT terminates fzf and it already responds with exit code 130 (one can start fzf alone in a terminal and press [Ctrl]-C followed by echo $?)

@pbek
Copy link
Member

pbek commented Dec 2, 2021

Let me know if you find a way to pass the exit code on...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants