Skip to content

termsize: doesn't work #30

Description

@bam80

Hi,
The script just doesn't work:

$ ./termsize 
Reset the terminal to 24 rows, 80 cols

Guest Fedora Linux 41.1.4 run in QEMU with console=ttyS0 kernel cmdline.
The same system is on host.

Contrary, this function works (but it needs stty which Anaconda (Fedora installer ISO) doesn't have):

res() {

  old=$(stty -g)
  stty raw -echo min 0 time 5

  printf '\0337\033[r\033[999;999H\033[6n\0338' > /dev/tty
  IFS='[;R' read -r _ rows cols _ < /dev/tty

  stty "$old"

  # echo "cols:$cols"
  # echo "rows:$rows"
  stty cols "$cols" rows "$rows"
}

Any help?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions