Skip to content

[linux] jobs -l prints one space too many after the + marker ('[1]+ PID' vs GNU '[1]+ PID') #233

Closed

Description

@caomengxuan666

Linux build (wt4/linuxrun), GNU 5.3.0 baseline.

Repro

sleep 0.3 & jobs -l; wait

Expected (GNU): [1]+ 17063 Running sleep 0.3 & (marker +, ONE space, pid, space, state padded to LONGEST_SIGNAL_DESC=27).
Actual (rubash): [1]+ 17080 Running sleep 0.3 & (two spaces between + and pid).

Owning code: src/executor/job_builtins.rs:974 format string "[{job_number}]{marker} {pid} {state_text:<27}..." - the comment says "a second space follows for the standard format" but the long format prints it too. GNU jobs.c pretty_print_job (jobs.c:2207 area): [%d]%c then for JOBS_PIDS the pid directly, then %s state.

Artifacts: target/wslrun/results/p1p2_identity.out.diff; probe_details.sh [G].

Activity

  1. added
    bug
    on Sep 27, 2026
  2. caomengxuan666 commented on Sep 27, 2026

    @caomengxuan666
    MemberAuthor

    已修复并合入 master(commit b2e41b4e,lane wt4/linuxfix;GNU 引用与验证见提交信息:Linux 真机 WSL 双壳验证、24 套件平价 17→19)。感谢报告!

  3. caomengxuan666 commented on Sep 27, 2026

    @caomengxuan666
    MemberAuthor

    wt5/audit source lane addendum (2026-09-28): beyond the marker-space count, GNU pads the PID field itself to width 5 in the jobs -l long format — third_party/bash/jobs.c print_pipeline() (jobs.c:2066 area): fprintf (stream, "%5ld", (long)p->pid).

    Verified against WSL GNU Bash 5.3.0 with a short pid (probe target/issue-suites/results/source-audit/probes/a5-jobs.sh, raw .../out/a5-jobs.diff):

    • GNU: [1]+ 23 Running sleep 0.3 & (pid right-aligned in 5 columns)
    • rubash: unpadded pid

    The 5-digit pids of the Windows build hide this half of the format string; any fix for the marker spacing should also add the %5ld padding so short pids (WSL/Linux children) round-trip.

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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions