From 31fc13cf0360e2d9d75cd7f44d8e7c7d4f4f4648 Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Sat, 12 Sep 2020 09:07:03 +0200 Subject: [PATCH] Resize serial terminal on login (#860) (#863) The new readline utilty used by the CLI add-on requires the size of the terminal to be set. Use the resize command to initialize terminal size on login if we are running on a serial terminal. --- buildroot-external/rootfs-overlay/usr/sbin/hassos-cli | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/buildroot-external/rootfs-overlay/usr/sbin/hassos-cli b/buildroot-external/rootfs-overlay/usr/sbin/hassos-cli index d3b018b5b..ddfbca0df 100755 --- a/buildroot-external/rootfs-overlay/usr/sbin/hassos-cli +++ b/buildroot-external/rootfs-overlay/usr/sbin/hassos-cli @@ -3,6 +3,12 @@ # Run logging cli # ============================================================================== +# Setup terminal size on serial console +if [ "${TERM}" = "vt220" ] || [ "${TERM}" = "vt102" ] || \ + [ "${TERM}" = "vt100" ]; then + resize +fi + # Run CLI container if [ "$(docker ps -q -f name=hassio_cli)" ]; then docker container exec \