Skip to content

who: implement for Windows - #14495

Open
wtcpython wants to merge 1 commit into
uutils:mainfrom
wtcpython:who-windows
Open

wtcpython wants to merge 1 commit into
uutils:mainfrom
wtcpython:who-windows

Conversation

@wtcpython

@wtcpython wtcpython commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

who was previously unavailable on Windows.

This adds a backend backed by WTS session information and enables it in the Windows feature set. Option parsing and output formatting remain shared with the Unix implementation.

Copilot AI lite review requested due to automatic review settings September 10, 2026 11:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@codspeed

codspeed Bot commented Sep 10, 2026 •

Copy link
Copy Markdown

Merging this PR will improve performance by 14.68%

⚡ 2 improved benchmarks
✅ 391 untouched benchmarks
⏩ 54 skipped benchmarks1

Performance Changes

Mode Benchmark BASE HEAD Efficiency
⚡ Simulation three_39_bit_primes 533 ms 459.1 ms +16.1%
⚡ Simulation five_38_bit_primes 1.8 s 1.6 s +13.28%

Tip

Curious why performance improved? Comment @codspeedbot explain why performance improved on this PR, or directly use the CodSpeed MCP with your agent.


Comparing wtcpython:who-windows (ff35f60) with main (2b85f6f)

Open in CodSpeed

Footnotes

  1. 54 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

@github-actions

github-actions Bot commented Sep 10, 2026 •

Copy link
Copy Markdown

GNU testsuite comparison:

Skipping an intermittent issue tests/date/resolution (passes in this run but fails in the 'main' branch)

Comment thread src/uu/who/src/platform/openbsd.rs Outdated
reason = "signature shared across platforms"
)]
pub(crate) fn exec(&mut self) -> UResult<()> {
println!("{}", translate!("who-unsupported-openbsd"));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it is actually not supported, this code should be removed. We don't suppprt building stubs.

Copilot AI review requested due to automatic review settings September 14, 2026 06:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@sylvestre

Copy link
Copy Markdown
Contributor

sorry, could you please rebase it

Copilot AI review requested due to automatic review settings September 17, 2026 01:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings September 17, 2026 01:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings September 17, 2026 01:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings September 19, 2026 01:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI lite review requested due to automatic review settings September 30, 2026 12:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@HackingRepo

HackingRepo commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

it bloated with 10 unsafes can we reduce it, safe rust can do some of these things?

Copilot AI lite review requested due to automatic review settings September 30, 2026 12:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@oech3

oech3 commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

This PR adds platform specific unsafe, but not for all. windows_sys generally requires many unsafes. I don't know any reasonable safe-wrapper for Win32APIs.

Copilot AI lite review requested due to automatic review settings October 1, 2026 11:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

Review effort: Lite
Findings: 1 High severity · 4 Medium severity

Open (5)

Comment on lines +61 to +68
for session in sessions(!self.all) {
if self.own_terminal_only && current_session != Some(session.id) {
continue;
}
if self.select.sessions && !session.user.is_empty() {
self.emit_session(&session)?;
}
}
/// minute, and the localized `old` past a day or before the given boot time.
pub(crate) fn format_idle<'a>(when: i64, since_boot: i64) -> Cow<'a, str> {
thread_local! {
static NOW: time::OffsetDateTime = time::OffsetDateTime::now_local().unwrap();
Comment on lines +27 to +28
// SAFETY: the pointer was returned by WTS and is freed exactly once.
unsafe { WTSFreeMemory(self.0.cast()) };
line: &session.line,
time: &time,
idle: &idle,
pid: &format!("{}", session.id),
Comment thread tests/by-util/test_who.rs
Comment on lines 8 to 16
use uutests::new_ucmd;
#[cfg(unix)]
use uutests::unwrap_or_return;
#[cfg(unix)]
use uutests::util::{TestScenario, expected_result, gnu_cmd_result};
#[cfg(unix)]
use uutests::util_name;
#[test]
fn test_invalid_arg() {
Copilot AI lite review requested due to automatic review settings October 2, 2026 10:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

This branch has not been deployed

No deployments
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.

5 participants