Skip to content

Conversation

@dezgeg
Copy link
Contributor

@dezgeg dezgeg commented Nov 22, 2025

Current tty resolution can give wrong result e.g. if the process has closed all fds of its controlling terminal. The proper way to do it seems to be based on field in /proc//stat, which gives a device number of the tty. Converting that to a device path requires parsing /proc/tty/drivers (according to strace of upstream ps).

After this ps, ps -x and ps -a give same processes as upstream ps.

@dezgeg dezgeg force-pushed the tty_fix branch 2 times, most recently from aceffac to 3eae2f0 Compare November 22, 2025 14:20
Current tty resolution can give wrong result e.g. if the process has
closed all fds of its controlling terminal. The proper way to do it
seems to be based on field in /proc/<pid>/stat, which gives a device
number of the tty. Converting that to a device path requires parsing
/proc/tty/drivers (according to strace of upstream ps).

After this `ps`, `ps -x` and `ps -a` give same processes as upstream ps.
@cakebaker cakebaker merged commit 883207c into uutils:main Nov 22, 2025
16 checks passed
@cakebaker
Copy link
Contributor

Thanks!

@codecov
Copy link

codecov bot commented Nov 22, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 0.00%. Comparing base (d8c380f) to head (316f8fc).
⚠️ Report is 15 commits behind head on main.

Additional details and impacted files
@@     Coverage Diff     @@
##   main   #578   +/-   ##
===========================
===========================

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

2 participants