【问题标题】:how does vim change the width of its terminal emulator?vim 如何改变其终端模拟器的宽度?
【发布时间】:2018-05-06 23:48:25
【问题描述】:

当 Vim 收到类似:set columns=88 的命令时,它会改变正在运行的终端窗口的宽度。它是如何做到的?

我一直认为有 ANSI 代码可以更改终端窗口的宽度和高度,但一再无法弄清楚它们是什么。

【问题讨论】:

  • vi.stackexchange.com 的好人可能知道这一点。
  • Vim 是开源的,请阅读它的代码。
  • 代码库的规模和著名的复杂性让我有点害怕。

标签: vim terminal ansi


【解决方案1】:

对于特定于 xterm 的代码,请参阅 http://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-Functions-using-CSI-_-ordered-by-the-final-character_s_:

CSI Ps ; Ps ; Ps t
    Window manipulation
    …
    Ps = 8  ;  height ;  width -> Resize the text area to given
    height and width in characters.

【讨论】:

    猜你喜欢
    • 2022-01-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-09-17
    • 1970-01-01
    • 2011-08-02
    • 2014-08-10
    • 2016-11-23
    相关资源
    最近更新 更多