diff --git a/bashtop b/bashtop index 7bd970a..59909fa 100755 --- a/bashtop +++ b/bashtop @@ -199,6 +199,7 @@ init_() { #? Collect needed information and set options before startig main loop #* Get max pid value and length proc[pid_max]="$(/dev/null; then @@ -2268,18 +2269,18 @@ draw_processes() { #? Draw processes and values to screen current_num=1 - print -v proc_out -rs -m $((line+y++)) $((col+1)) -fg 235 235 235 -b -t "${proc_array[0]} " -rs + print -v proc_out -rs -m $((line+y++)) $((col+1)) -fg 235 235 235 -b -t "${proc_array[0]::$((width-3))} " -rs for out_line in "${proc_array[@]:$proc_start}"; do - pid="${out_line::${proc[pid_len]}}"; pid="${pid##* }" + pid="${out_line::$((proc[pid_len]+1))}"; pid="${pid// /}" pid_graph="pid_${pid}_graph" if ((current_num==proc[selected])); then print -v proc_out -bg "#7e2626" -b; proc[selected_pid]="$pid" else print -v proc_out -rs; fi - print -v proc_out -m $((line+y)) $((col+1)) -fg $((rgb-step)) $((rgb-step)) $((rgb-step)) -t "${out_line} " + print -v proc_out -m $((line+y)) $((col+1)) -fg $((rgb-step)) $((rgb-step)) $((rgb-step)) -t "${out_line::$((width-3))} " if ((current_num==proc[selected])); then print -v proc_out -rs -bg "#7e2626"; fi print -v proc_out -m $((line+y)) $((col+width-12)) -fg $((rgb_d-d_step)) $((rgb_d-d_step)) $((rgb_d-d_step)) -t "⡀⡀⡀⡀⡀"