# --- T2-COPYRIGHT-NOTE-BEGIN --- # T2 SDE: package/*/sysfiles/etc_inittab.txt # Copyright (C) 2022 - 2023 The T2 SDE Project # # This Copyright note is generated by scripts/Create-CopyPatch, # more information can be found in the files COPYING and README. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2. # --- T2-COPYRIGHT-NOTE-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 )