Skip to content

Conversation

@SteveL-MSFT
Copy link
Member

@SteveL-MSFT SteveL-MSFT commented Jun 26, 2018

PR Summary

macOS has a number of nameless processes. When tab expansion gets called, the empty process names results in an exception which fails the entire completer. Fix is to skip processes with empty name so that the named processes still show up in the result list.

Fix #7174

PR Checklist


if (string.IsNullOrEmpty(listItemText))
{
continue;
Copy link
Collaborator

Choose a reason for hiding this comment

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

If we now silently skip empty strings should we document this?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm surprised a process might not have a name - is this patching over a problem elsewhere, like in .Net?

At any rate, a comment on why this is expected would be useful.

Copy link
Member Author

Choose a reason for hiding this comment

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

@lzybkr if I run PowerShell with sudo, the process names are there. So presumably these are system processes where some properties are protected. I'll add a comment.

Copy link
Collaborator

@BrucePay BrucePay left a comment

Choose a reason for hiding this comment

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

LGTM

@adityapatwardhan adityapatwardhan merged commit 5f47fc0 into PowerShell:master Jun 27, 2018
@SteveL-MSFT SteveL-MSFT deleted the get-process-completer branch October 26, 2018 21:35
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.

No-argument tab-completion fails with Get-Process on macOS, possibly due to process objects lacking a ProcessName property

5 participants