@@ -1658,10 +1658,11 @@ namespace Proc {
1658
1658
out += Mv::to (d_y + 5 + i++, d_x + 1 ) + l;
1659
1659
1660
1660
out += Theme::c (" main_fg" ) + Fx::ub;
1661
- const int cmd_size = ulen (detailed.entry .cmd , true );
1661
+ const auto san_cmd = replace_ascii_control (detailed.entry .cmd );
1662
+ const int cmd_size = ulen (san_cmd, true );
1662
1663
for (int num_lines = min (3 , (int )ceil ((double )cmd_size / (d_width - 5 ))), i = 0 ; i < num_lines; i++) {
1663
1664
out += Mv::to (d_y + 5 + (num_lines == 1 ? 1 : i), d_x + 3 )
1664
- + cjust (luresize (detailed. entry . cmd , cmd_size - (d_width - 5 ) * i, true ), d_width - 5 , true , true );
1665
+ + cjust (luresize (san_cmd , cmd_size - (d_width - 5 ) * i, true ), d_width - 5 , true , true );
1665
1666
}
1666
1667
1667
1668
}
@@ -1855,14 +1856,16 @@ namespace Proc {
1855
1856
}
1856
1857
}
1857
1858
1858
- if (not p_wide_cmd.contains (p.pid )) p_wide_cmd[p.pid ] = ulen (p.cmd ) != ulen (p.cmd , true );
1859
+ const auto san_cmd = replace_ascii_control (p.cmd );
1860
+
1861
+ if (not p_wide_cmd.contains (p.pid )) p_wide_cmd[p.pid ] = ulen (san_cmd) != ulen (san_cmd, true );
1859
1862
1860
1863
// ? Normal view line
1861
1864
if (not proc_tree) {
1862
1865
out += Mv::to (y+2 +lc, x+1 )
1863
1866
+ g_color + rjust (to_string (p.pid ), 8 ) + ' '
1864
1867
+ c_color + ljust (p.name , prog_size, true ) + ' ' + end
1865
- + (cmd_size > 0 ? g_color + ljust (p. cmd , cmd_size, true , p_wide_cmd[p.pid ]) + Mv::to (y+2 +lc, x+11 +prog_size+cmd_size) + ' ' : " " );
1868
+ + (cmd_size > 0 ? g_color + ljust (san_cmd , cmd_size, true , p_wide_cmd[p.pid ]) + Mv::to (y+2 +lc, x+11 +prog_size+cmd_size) + ' ' : " " );
1866
1869
}
1867
1870
// ? Tree view line
1868
1871
else {
@@ -1875,7 +1878,7 @@ namespace Proc {
1875
1878
width_left -= (ulen (p.name ) + 1 );
1876
1879
}
1877
1880
if (width_left > 7 ) {
1878
- const string_view cmd = width_left > 40 ? rtrim (p. cmd ) : p.short_cmd ;
1881
+ const string_view cmd = width_left > 40 ? rtrim (san_cmd ) : p.short_cmd ;
1879
1882
if (not cmd.empty () and cmd != p.name ) {
1880
1883
out += g_color + ' (' + uresize (string{cmd}, width_left - 3 , p_wide_cmd[p.pid ]) + " ) " ;
1881
1884
width_left -= (ulen (string{cmd}, true ) + 3 );
0 commit comments