tmo fallback fails when the caller's stdin is closed

Open
#197 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@STRML is already working on this.

Since Nov 15, 2026.

  • #198 by @STRML — open

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
32/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
bash, shell
Domain
tooling

Research direction

The fix lands in the tmo wrapper script, at the point where it saves stdin with exec 3<&0 before backgrounding; read that block first, then the existing no-timeout fallback case in tests/portable.sh. Add the /dev/null fallback there and extend that test with a 0<&- case. Done looks like threads.sh list --json 0<&- returning [] with neither timeout nor gtimeout installed. Note a pull request (#198) is already open for this, so coordinate before starting.

Written by the indexing model from the issue text.

Description

From the gate on https://github.com/STRML/autodream/pull/196 (round 3, non-blocking). With neither timeout nor gtimeout installed, tmo now saves stdin with exec 3<&0 before backgrounding the command. If the caller closed stdin (0<&-), that exec fails and the command never starts: threads.sh list --json 0<&- reports a jq failure, while the same call with timeout available returns [].

Fix: fall back to /dev/null when stdin is closed (exec 3<&0 2>/dev/null || exec 3</dev/null), with a test in tests/portable.sh beside the existing fallback case. Landing in the autodream web part 2 PR.

Dominant language
Shell
Stars
0
Forks
2
Avg merge
11h 31m
Merged PRs (30d)
26

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from STRML/autodream

All issues in STRML/autodream

Similar issues

More Shell/Bash issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.