Quick fix for scanner output width auto-adjust.

This commit is contained in:
Matias Barcenas 2017-08-11 21:49:34 -05:00
parent 8e3511e921
commit d3f46cbd10
1 changed files with 6 additions and 3 deletions

View File

@ -727,9 +727,12 @@ function set_target_ap() {
fi
done
# Todo: WiFi scanner bug here, spacing is off when dealing with large fields.
local header=$(printf "%44s\n\n$CRed[$CYel * $CRed]$CClr %-30s %4s %3s %3s %4s %6s %18s\n" "WIFI LIST" "SSID" "QLTY" "PWR" "CL" "CH" "SEC" "MAC ADDRESS")
io_query_format_fields "$header" "$CRed[$CYel%03d$CRed]%b %-30s %3s%% %3s %3d %4s %6s %18s\n" \
local bashWidth=$(tput cols)
local ssidWidth=$(($bashWidth - 51))
local headWidth=$(($bashWidth / 2 + 4))
local header=$(printf "%${headWidth}s\n\n$CRed[$CYel * $CRed]$CClr %-${ssidWidth}s %4s %3s %3s %4s %6s %18s\n" "WIFI LIST" "SSID" "QLTY" "PWR" "CL" "CH" "SEC" "MAC ADDRESS")
io_query_format_fields "$header" "$CRed[$CYel%03d$CRed]%b %-${ssidWidth}s %3s%% %3s %3d %4s %6s %18s\n" \
TargetAPCandidatesColor[@] \
TargetAPCandidatesESSID[@] \
TargetAPCandidatesQuality[@] \