dotnet/diagnostics

"dotnet-dump ps" truncates commandline arguments at 60 positions

monty241 opened this issue · 2 comments

Description

Executing dotnet-dump ps on Linux, there can be commandline arguments exceeding 60 positions. However, only the last 60 are shown in the table.

Sample:

dotnet-dump ps

   1246  dotnet  /usr/local/aspnetcore7012/dotnet  tnet /usr/local/abc-123456.abcde/ABCDEFGHI.Abcde.Online.dll
   1248  dotnet  /usr/local/aspnetcore7012/dotnet  t /usr/local/abcde-123456.abcde/ABCDEFGHI.Abcde.Online.dll
   1249  dotnet  /usr/local/aspnetcore7012/dotnet  in/dotnet /usr/local/abcde.ABCDEFGHI.com/ABCDEFGHI.Abcde.dll

Version: 8.0.452401+966acd12b91675a4d06a7572ff47c587f827beaf

Hi @monty241 thanks for reporting this issue! We'd like to learn more about what expectations there are for the UI. With some experimentation, we can see that dotnet-dump ps scales the width of the columns based off of the width of the console. Would you prefer different options on how process name and argument widths are calculated, screen wrapping, or different defaults?

C:\Users\tommcdon>dotnet-dump ps
 12764  dotnet               m Files\dotnet\dotnet.exe  ost\ms-dotnettools.csharp
 13096  PhoneExperienceHost  e\PhoneExperienceHost.exe  ver:Background -Embedding
 16088  pwsh                 les\PowerShell\7\pwsh.exe  gration.ps1\" } catch {}"
 16468  rzls                 win32-x64\.razor\rzls.exe  alStudio.DevKit.Razor.dll


C:\Users\tommcdon>dotnet-dump ps
 12764  dotnet               C:\Program Files\dotnet\dotnet.exe                           \logs\20240104T145552\window1\exthost\ms-dotnettools.csharp
 13096  PhoneExperienceHost  ne_1.23102.126.0_x64__8wekyb3d8bbwe\PhoneExperienceHost.exe  e\PhoneExperienceHost.exe" -ComServer:Background -Embedding
 16088  pwsh                 C:\Program Files\PowerShell\7\pwsh.exe                       b\terminal\browser\media\shellIntegration.ps1\" } catch {}"
 16468  rzls                 ions\ms-dotnettools.csharp-2.14.8-win32-x64\.razor\rzls.exe  x64\.razortelemetry\Microsoft.VisualStudio.DevKit.Razor.dll


C:\Users\tommcdon>dotnet-dump ps
 12764  dotnet               C:\Program Files\dotnet\dotnet.exe                                 g\Code\logs\20240104T145552\window1\exthost\ms-dotnettools.csharp
 13096  PhoneExperienceHost  ourPhone_1.23102.126.0_x64__8wekyb3d8bbwe\PhoneExperienceHost.exe  3d8bbwe\PhoneExperienceHost.exe" -ComServer:Background -Embedding
 16088  pwsh                 C:\Program Files\PowerShell\7\pwsh.exe                             contrib\terminal\browser\media\shellIntegration.ps1\" } catch {}"
 16468  rzls                 extensions\ms-dotnettools.csharp-2.14.8-win32-x64\.razor\rzls.exe  win32-x64\.razortelemetry\Microsoft.VisualStudio.DevKit.Razor.dll

Thx for response.

The use was on Linux, so for easiest adoptation it would be align with traditional ps statement on Linux, such as:

user@xxx:/PWD# ps -ef|grep dotnet
user        1247       1 99 07:40 ?        1-12:56:26 /usr/bin/dotnet /usr/local/acme.cloud/Acme.dll
user        1248       1  9 07:40 ?        00:27:29 /usr/bin/dotnet /usr/local/acme.com/Acme.dll
user        1249       1  0 07:40 ?        00:02:00 /usr/bin/dotnet /usr/local/acme.com/Acme.dll
user        1250       1  1 07:40 ?        00:03:48 /usr/bin/dotnet /usr/local/acme.com/Acme.dll
user        1251       1  1 07:40 ?        00:03:53 /usr/bin/dotnet /usr/local/acme.nl/Acme.dll
user       38586       1 13 11:48 ?        00:07:17 /usr/bin/dotnet /usr/local/acme.cloud/Acme.dll

On Linux, no truncation takes place.

But any option which avoids silent truncation would be considered by me an improvement.

As a fallback option, displaying ellipsis ('...') when truncation applies would be of assistance and guide the sysadmin to the fact part of the text is missing. This can be done at start or end, but maybe best in the middle since that typically provides the most little added value, such as:

abcdef...xyz