1

I have set stty cols 72 in my xterm terminal.

How to unset it to normal? Because when I change the size of that terminal, cols always set to 72 and can't stretch to current resized terminal window.

I run stty cols 72 && w3m https://google.com, so I need to reset stty cols back to last state of terminal window.

I do have stty set in ~/.zshrc that enables some options, too.

1
  • @roaima: e.g: I run stty cols 72 && w3m https://google.com, so I need to reset stty cols back to last state of terminal window. I do have stty set in ~/.zshrc that enable some options only.
    – Tuyen Pham
    Dec 29, 2019 at 12:51

1 Answer 1

5

Blindly answering the question you've asked, you can save the current column width and then restore it like this

c=$(tput cols)    # Save the columns
stty cols 72      # Change the characteristics temporarily
#...
stty cols $c      # Restore the saved width

But I would have to ask why you need to perform stty cols 72 at all. You're using an xterm, so it should notify its process leader (i.e. the shell) automatically of any change when you resize it.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .