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

Missing S_ISSOCK for stdin check #1538

Open
Jarred-Sumner opened this issue Mar 21, 2024 · 1 comment
Open

Missing S_ISSOCK for stdin check #1538

Jarred-Sumner opened this issue Mar 21, 2024 · 1 comment

Comments

@Jarred-Sumner
Copy link

In Node.js & Bun, spawned subprocesses by default use socketpair instead of pipe for stdin. This makes it easier to prevent read() & write() calls from blocking without setting a file descriptor to O_NONBLOCK (i.e. without observably impacting the other process which may or may not handle EAGAIN correctly)

This usually works great, but it unfortunately seems to break using ag in a subprocess in Bun.

Is this check missing S_ISSOCK? or possibly isatty(0)?

if (S_ISFIFO(statbuf.st_mode) || S_ISREG(statbuf.st_mode)) {

Related oven-sh/bun#9510

@LeoniePhiline
Copy link

There hasn't been a single commit in 4 years. Switch from ag to something like ripgrep.

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

No branches or pull requests

2 participants