Skip to content

Commit

Permalink
Remove hardcoded cursor shift
Browse files Browse the repository at this point in the history
  • Loading branch information
rashil2000 committed Jan 21, 2022
1 parent c3c9105 commit cf8861e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions winfetch.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -973,7 +973,7 @@ if (-not $stripansi) {
$writtenLines = 0
$freeSpace = $Host.UI.RawUI.WindowSize.Width - 1

# move cursor to top of image and to column 40
# move cursor to top of image and to its right
if ($img -and -not $stripansi) {
$freeSpace -= 1 + $COLUMNS + $GAP
Write-Output "$e[$($img.Length + 1)A"
Expand Down Expand Up @@ -1007,8 +1007,8 @@ foreach ($item in $config) {

if ($img) {
if (-not $stripansi) {
# move cursor to column 40
$output = "$e[40G$output"
# move cursor to right of image
$output = "$e[$(2 + $COLUMNS + $GAP)G$output"
} else {
# write image progressively
$imgline = ("$($img[$writtenLines])" -replace $ansiRegex, "").PadRight($COLUMNS)
Expand Down

0 comments on commit cf8861e

Please sign in to comment.