Skip to content

fix(ps): Cygwin listing face + -W/--windows (niubash#993 S5) - #1786

Merged
caomengxuan666 merged 3 commits into
mainfrom
fix/niu993-1785-ps-w
Nov 16, 2026
Merged

caomengxuan666 merged 3 commits into
mainfrom
fix/niu993-1785-ps-w

Conversation

@caomengxuan666

Copy link
Copy Markdown
Member

Closes #1785. niubash#993 audit row S5: niu -c 'ps -W' failed (flag unsupported) and the default ps layout had no WINPID column.

What changed

  • ps / ps -W now print the Cygwin/Git-Bash listing face:
    PID PPID PGID WINPID TTY UID STIME COMMAND
  • -W/--windows selects the whole Windows process table (no session/user restriction)
  • PID == WINPID == the real Windows PID — niubash has no second PID namespace (Cygwin's +0x400000 marker only exists to separate its synthetic pids from winpids); PGID is 0
  • UID is the account-SID RID — the same value Cygwin reports for the account (e.g. domain RID)
  • STIME prints HH:MM:SS for same-day starts, Mon D for older, blank when the kernel won't disclose the create time
  • COMMAND shows the shell-mount spelling for processes inside the shell root (/usr/bin/..., /home/...) and the native image path otherwise — the same distinction Cygwin draws for its own processes

Test plan

  • ps.* — 18/18 including 4 new S5 pins (face header, -W breadth, -W -p filter, PID==WINPID)
  • CI

Git Bash ps (Cygwin) prints PID PPID PGID WINPID TTY UID STIME
COMMAND; WinuxCmd's ps had its own PID/TTY/TIME/CMD layout and no -W.
S5 of the niubash#993 audit.

- default listing now uses the Cygwin column layout; PID == WINPID ==
  the real Windows PID (niubash has no second pid namespace), PGID 0
- -W/--windows selects the whole Windows process table
- UID column is the account-SID RID, the same derivation Cygwin uses
- STIME prints HH:MM:SS for same-day starts, "Mon  D" for older ones
- COMMAND shows the shell-mount spelling for processes inside the
  shell root (/usr/bin/...) and the native image path otherwise, the
  same distinction Cygwin draws for its own processes
The -W option adds command.ps.option.windows to the extracted
catalog; the zh-CN catalog sync happens in the winuxcmd-i18n repo.
Re-recording also captures the standing drift's shrink after the
i18n repo's 0.6.49 mirror sync.
caomengxuan666 added a commit that referenced this pull request Nov 16, 2026
…t reconstructed spelling (#1793)

The pin recomputed the expected /tmp-vs-/c/ display from tmp.path; on the CI
runner the temp mount and TempDir root don't line up, so the reconstruction
mismatched even though all three emitters agreed. Assert the actual §7
contract instead: realpath == pwd output, readlink -f appends /f, no
backslashes. Fixes the x64-default ctest failure seen on #1786's merge run.

Generated with [Devin](https://devin.ai)

Co-authored-by: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@caomengxuan666
caomengxuan666 merged commit ce4342e into main Nov 16, 2026
23 of 28 checks passed
caomengxuan666 pushed a commit that referenced this pull request Nov 16, 2026
zh-CN catalog 0.6.51 (77cd698) carries command.du.error.* keys ahead of
their source landing in #1794; ps.option.windows and legacy.ce93f5c9d7140354
drift resolved by #1786 + catalog 0.6.50.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
caomengxuan666 added a commit that referenced this pull request Nov 16, 2026
* test(stat): pin %F 'regular empty file' audit ruling (niubash#993 S9) (#1787)

The audit flagged 'regular file' vs 'regular empty file' for `: > f`;
current main already emits GNU 9.4's exact wording. No behavior
change — pin the audit repro so it can't regress.

* chore(i18n): refresh drift baseline — record du.error.* companion keys

zh-CN catalog 0.6.51 (77cd698) carries command.du.error.* keys ahead of
their source landing in #1794; ps.option.windows and legacy.ce93f5c9d7140354
drift resolved by #1786 + catalog 0.6.50.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>

---------

Co-authored-by: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
caomengxuan666 added a commit that referenced this pull request Nov 16, 2026
… merged C++ surface PRs (#1781 #1786 #1795 family)

The gate's own protocol for deliberate new source strings: record the
growth so the ratchet stays honest (it may only shrink as translation
sync batches land in unixwin/winuxcmd-i18n). The 22 zh-CN legacy.*
missing items come from the C++ command surface that landed with the
/dev synthesis, ps -W and cp-revert wave — all merged by owner; their
zh-CN translations ride the next i18n sync batch (same choreography as
the du keys earlier today).

Verified locally on origin/main (f6d5386): same 22-item set as the
failing CI run 43814990474; en-US side clean.
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

Successfully merging this pull request may close these issues.

ps: Git-Bash-compatible listing face + -W/--windows (WINPID column) (niubash#993 S5)

1 participant