• 请不要在回答技术问题时复制粘贴 AI 生成的内容
chenfang
V2EX  ›  程序员

iterm2 的一些使用问题

  •  
  •   chenfang · Jun 1, 2023 · 1923 views
    This topic created in 1117 days ago, the information mentioned may be changed or developed.
    1. 连接 ssh 之后,有时候敲命令大于 1 行之后不换行而是在当前行的前边,虽然最后可以执行,但是命令是叠在一起的,就很难受

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

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

    Supplement 1  ·  Jun 1, 2023
    偶然间查到了 是 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 replies    2023-06-01 16:38:02 +08:00
    ruanimal
        1
    ruanimal  
       Jun 1, 2023
    1. 是正常情况吧
    2. 大概是 vim 配置有问题,或者终端类型不对 https://www.cs.odu.edu/~cs252/Book/termtypes.html
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5888 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 03:20 · PVG 11:20 · LAX 20:20 · JFK 23:20
    ♥ Do have faith in what you're doing.