# --- T2-COPYRIGHT-BEGIN --- # t2/package/*/sysfiles/etc_profile.d_console.txt # Copyright (C) 2022 - 2026 The T2 SDE Project # SPDX-License-Identifier: GPL-2.0 # --- T2-COPYRIGHT-END --- # Auto re-size common serial consoles. # If stdin is a terminal and default size? [[ -t 0 && "$COLUMNS" = 80 && "$LINES" = 24 ]] && ( IFS='[;' # escape geometry x y echo -ne '\e7\e[r\e[999;999H\e[6n\e8' if read -t 5 -sd R escape geometry; then x="${geometry##*;}" y="${geometry%%;*}" if [[ "$x" -gt 0 && "$y" -gt 0 && ($COLUMNS != "$x" || $LINES != "$y") ]]; then #echo "${COLUMNS}x${LINES} -> ${x}x${y}" stty cols ${x} rows ${y} fi fi )