2月 272015
 

问题

通过ssh连接到服务器后,当终端窗口放大后,打开vim依然使用原来的小的区域

分析

  • 查看当前tty的size

     
  • 查看当前tty的更多信息

     
  •  resize 命令更新tty信息

    不幸的是,一般都没有这个命令,ubuntu中有这个命令,而且应该是在终端窗口变化时自动执行了,所以,在ubuntu中打开一个终端后缩放是及时生效的
  • 因为当终端窗口发生变化时,虽然不能重绘已有的内容,但是后续执行的ls命令都是能感知到窗口大小的变化的,为什么其他命令(如 vim)感知不到? resize命令是如何实现的?如何安装resize命令? 

 

参考资料:

http://superuser.com/questions/390935/how-can-i-get-terminal-to-repaint-the-contents-when-i-resize-the-terminal

http://stackoverflow.com/questions/19157202/how-do-terminal-size-changes-get-sent-to-command-line-applications-though-ssh-or   这个写的详细些

http://teaching.idallen.com/dat2330/06w/notes/terminal.txt

 Posted by at 下午 4:45

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">

(required)

(required)

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据