Skip to content

[bug] \j always expands to 0 despite live background jobs #1098

Closed

Description

@caomengxuan666

[bug] \j always expands to 0 despite live background jobs (breaks job-count prompt segments)

sleep 5 & jp=$!
jobs                       # both: "[1]+  Running  sleep 5 &" (job table OK)
PS1='\j'; echo "${PS1@P}"  # bash: 1 / niu: 0
kill "$jp" 2>/dev/null; wait 2>/dev/null

With 2 sleeps: bash 2, niu 0. After reap: both 0. Under set -m: bash 1, niu 0. The gap is specifically in the \j expansion lookup, not job tracking.

Env: niubash 1.4.4 / rubash engine (master ~2026-10), GNU bash 5.3.20 aarch64-linux-android as oracle.

Activity

  1. added
    bug
    gnu-baseline
    area:interactive
    P2-medium
    on Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2-mediumarea:interactivebuggnu-baseline

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions