You are probably missing a $ before COLUMNS and export before setting DELTA_FEATURES
$ TEST=3
$ if [[ TEST -gt 2 ]]; then echo "honk"; fi
honk
$ TEST=1
$ if [[ TEST -gt 2 ]]; then echo "honk"; fi
$
That lets you do things like $ if [[ TEST*3 -gt 6 ]]; ...
without having to nest even more double parentheses.You're correct about having to export DELTA_FEATURES at least once. (I export it outside of the function, but no harm in doing so whenever it's set -- but it's not required to re-export it when you change the value.) Thanks for catching that!