V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
chenfang
V2EX  ›  程序员

iterm2 的一些使用问题

  •  
  •   chenfang · 328 天前 · 1128 次点击
    这是一个创建于 328 天前的主题,其中的信息可能已经有所发展或是发生改变。
    1. 连接 ssh 之后,有时候敲命令大于 1 行之后不换行而是在当前行的前边,虽然最后可以执行,但是命令是叠在一起的,就很难受

    2. 我是外接了一个显示器,然后拖拽窗口到另外一个显示器后,窗口大小会发生变化,这会导致 vim 有问题,貌似是 vim 不能识别到窗口变化后的大小,从而导致使用 vim 显示有问题 18facc80e90e6051d544f2b2b1bfdf9a.png e0f812f00324c4dc4c26e5b09db4aaa7.png

    这两个问题有解决方案么?谢谢大家

    第 1 条附言  ·  327 天前
    偶然间查到了 是 except 的脚本问题
    ```bash
    #!/usr/bin/expect
    trap {
    set rows [stty rows]
    set cols [stty columns]
    stty rows $rows columns $cols < $spawn_out(slave,name)
    } WINCH
    set timeout 30
    spawn ssh -p [lindex $argv 0] [lindex $argv 1]@[lindex $argv 2]
    expect {
    "(yes/no)?"
    {send "yes\n";exp_continue}
    "password:"
    {send "[lindex $argv 3]\n"}
    }
    interact
    ```
    我新增了
    ```bash
    trap {
    set rows [stty rows]
    set cols [stty columns]
    stty rows $rows columns $cols < $spawn_out(slave,name)
    } WINCH
    ```

    这样就 OK 解决了
    1 条回复    2023-06-01 16:38:02 +08:00
    ruanimal
        1
    ruanimal  
       327 天前
    1. 是正常情况吧
    2. 大概是 vim 配置有问题,或者终端类型不对 https://www.cs.odu.edu/~cs252/Book/termtypes.html
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5307 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 07:47 · PVG 15:47 · LAX 00:47 · JFK 03:47
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.