Skip to content
New issue

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

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

Already on GitHub? # to your account

Allow | head commands from terminal #107

Closed
KatrionaGoldmann opened this issue Aug 14, 2023 · 1 comment
Closed

Allow | head commands from terminal #107

KatrionaGoldmann opened this issue Aug 14, 2023 · 1 comment

Comments

@KatrionaGoldmann
Copy link
Contributor

KatrionaGoldmann commented Aug 14, 2023

Using whatwhat person ... | head returns an error:

Fatal error: exception Sys_error("Broken pipe")

Suspected cause is due to broken pipe signal (see SO question)

We probably want to catch this exception and ignore the error

@yongrenjie
Copy link
Contributor

yongrenjie commented Nov 3, 2023

Digging into this more deeply, you can't even catch the exception and call exit, because exit causes stdout/stderr to be flushed and this flushing triggers the broken pipe error again.

The opam tool has handled this before: ocaml/opam#4216

And the associated PR is probably a good reference of how to fix it: ocaml/opam#4901 The strategy, it seems, is to silently flush stdout and stderr before exiting.

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

No branches or pull requests

2 participants