scripts/shell/resize.sh
2024-03-20 11:28:46 -05:00

12 lines
495 B
Bash
Executable file

#!/bin/sh
#
# SPDX-License-Identifier: MIT
# shellcheck disable=SC2268
if ! command -v resize > /dev/null; then
if [ "x$SHELL" = "x/bin/bash" ]; then
alias resize='shopt -s checkwinsize;COLUMNS=$(tput cols);LINES=$(tput lines);export COLUMNS LINES;echo -e "COLUMNS=$COLUMNS;\nLINES=$LINES;\nexport COLUMNS LINES;"'
else
alias resize='COLUMNS=$(tput cols);LINES=$(tput lines);export COLUMNS LINES;echo "COLUMNS=$COLUMNS;\nLINES=$LINES;\nexport COLUMNS LINES;"'
fi
fi