diff options
author | Arjun P <arjunpitchanathan@gmail.com> | 2022-10-30 09:27:56 +0000 |
---|---|---|
committer | Arjun P <arjunpitchanathan@gmail.com> | 2022-10-30 09:27:56 +0000 |
commit | bb40de64c9ea3962bcda483a1af5ab5a69edfc48 (patch) | |
tree | d699edf5c1482b6edf419a170ed6cf13cce62756 /src | |
parent | 4fbda9df29f97b1762f68112f50b7f1e1817097f (diff) |
Fix bug in proc_tree view when showing full cmd
Diffstat (limited to 'src')
-rw-r--r-- | src/btop_draw.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/btop_draw.cpp b/src/btop_draw.cpp index 4ea14f9..099a1aa 100644 --- a/src/btop_draw.cpp +++ b/src/btop_draw.cpp @@ -1473,9 +1473,12 @@ namespace Proc { out += c_color + uresize(p.name, width_left - 1) + end + ' '; width_left -= (ulen(p.name) + 1); } - if (width_left > 40 or (width_left > 7 and p.short_cmd != p.name)) { - out += g_color + '(' + uresize(width_left > 40 ? p.cmd : p.short_cmd, width_left - 3, p_wide_cmd[p.pid]) + ") "; - width_left -= (ulen(p.short_cmd, true) + 3); + if (width_left > 7) { + const string& cmd = width_left > 40 ? p.cmd : p.short_cmd; + if (not cmd.empty() and cmd != p.name) { + out += g_color + '(' + uresize(cmd, width_left - 3, p_wide_cmd[p.pid]) + ") "; + width_left -= (ulen(cmd, true) + 3); + } } out += string(max(0, width_left), ' ') + Mv::to(y+2+lc, x+2+tree_size); } |