Skip to content

Commit

Permalink
Fixed the scrolling issue
Browse files Browse the repository at this point in the history
Also added a dry-run argument, might come in handy. Also clearing the screen before the script starts
  • Loading branch information
Aniket-Pradhan committed Aug 24, 2019
1 parent 6f94706 commit a33681d
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions lsd-sim
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
#!/bin/bash

# Global Variables

# Setting rows and width equal to the terminal size.

# Decrementing $rows, as more number of rows cause the screen to scroll. Which we don't want.
rows=$(tput lines);
rows=${$rows - 1};
rows=$rows-2;

width=$(tput cols);

Expand All @@ -19,6 +17,12 @@ printf "\033c"
# Take the user parameters.
while test $# -gt 0; do
case "$1" in
-d | --dry-run)
echo $rows;
exit;
shift;
;;

-r | --rows)
shift
rows=$1
Expand Down Expand Up @@ -49,6 +53,9 @@ while test $# -gt 0; do
esac
done

# Clear screen first
printf "\033c";

# An infinite loop.
for((j=1; j<3;)); do

Expand Down

0 comments on commit a33681d

Please sign in to comment.