我已经stty cols 72在我的xterm终端中设置了。
怎么恢复正常呢?因为当我更改该终端的大小时,cols始终设置为72并且无法拉伸到当前调整大小的终端窗口。
我运行stty cols 72 && w3m https://google.com,所以我需要重置stty cols回终端窗口的最后状态。
我确实也stty设置了~/.zshrc一些选项。
盲目回答你所问的问题,你可以保存当前的列宽,然后像这样恢复它
c=$(tput cols) # Save the columns
stty cols 72 # Change the characteristics temporarily
#...
stty cols $c # Restore the saved width
Run Code Online (Sandbox Code Playgroud)
但我不得不问你为什么需要表演stty cols 72。您正在使用xterm,因此当您调整大小时,它应该自动通知其进程领导者(即 shell)任何更改。
| 归档时间: |
|
| 查看次数: |
668 次 |
| 最近记录: |