Merge pull request #452 from Superty/main

proc tree view: if there's more than 40 width left, print full cmd
This commit is contained in:
Jakob P. Liljenberg 2022-10-29 00:42:53 +02:00 committed by GitHub
commit 011cf650c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -1473,8 +1473,8 @@ namespace Proc {
out += c_color + uresize(p.name, width_left - 1) + end + ' ';
width_left -= (ulen(p.name) + 1);
}
if (width_left > 7 and p.short_cmd != p.name) {
out += g_color + '(' + uresize(p.short_cmd, width_left - 3, p_wide_cmd[p.pid]) + ") ";
if (width_left > 30 || (width_left > 7 && p.short_cmd != p.name)) {
out += g_color + '(' + uresize(width_left > 30 ? p.cmd : p.short_cmd, width_left - 3, p_wide_cmd[p.pid]) + ") ";
width_left -= (ulen(p.short_cmd, true) + 3);
}
out += string(max(0, width_left), ' ') + Mv::to(y+2+lc, x+2+tree_size);