coreutils icon indicating copy to clipboard operation
coreutils copied to clipboard

stty: add options to set and print terminal size

Open willshuttleworth opened this issue 7 months ago • 1 comments

fixes for #3859. adds options for setting the size of the terminal's rows and columns, and printing the current size.

  • stty rows <n>
  • stty columns <n> or stty cols <n>
  • stty size

i did add some new unsafe blocks, as ioctl calls are needed to get and set terminal size. i couldn't find documentation of what row/col sizes are accepted by GNU's stty, but i did some testing and am matching their behavior. i also added tests to confirm this behavior.

willshuttleworth avatar Jun 18 '25 17:06 willshuttleworth

GNU testsuite comparison:

Skip an intermittent issue tests/misc/tee (fails in this run but passes in the 'main' branch)

github-actions[bot] avatar Jun 18 '25 18:06 github-actions[bot]

GNU testsuite comparison:

Skipping an intermittent issue tests/misc/tee (passes in this run but fails in the 'main' branch)

github-actions[bot] avatar Jun 19 '25 13:06 github-actions[bot]

Thanks :)

cakebaker avatar Jun 19 '25 14:06 cakebaker

thanks for reviewing!

willshuttleworth avatar Jun 19 '25 15:06 willshuttleworth