ggreer / the_silver_searcher

A code-searching tool similar to ack, but faster.

Home Page:http://geoff.greer.fm/ag/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Missing `S_ISSOCK` for stdin check

Jarred-Sumner opened this issue · comments

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

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