Use -z to check if almostontop is enabled

This commit is contained in:
Kenneth Benzie 2018-04-24 16:14:35 +01:00
parent 9f7367c550
commit c5cda7afde

View File

@ -8,7 +8,6 @@ prompt_fresh_setup() {
fresh_compile_git_prompt fresh_compile_git_prompt
# Parse options # Parse options
local almostontop=0
while getopts 'a' opt; do while getopts 'a' opt; do
case $opt in case $opt in
a) local almostontop=1 ;; a) local almostontop=1 ;;
@ -23,7 +22,7 @@ prompt_fresh_setup() {
# cause lines before the prompt to disappear. # cause lines before the prompt to disappear.
add-zsh-hook precmd fresh_line_one add-zsh-hook precmd fresh_line_one
if [ $almostontop -eq 1 ]; then if [ -z $almostontop ]; then
# Hook to clear the screen then prints the prompt with previous command at # Hook to clear the screen then prints the prompt with previous command at
# the top of the screen. # the top of the screen.
add-zsh-hook preexec fresh_almostontop add-zsh-hook preexec fresh_almostontop