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

尝试了下 wezterm,推荐试用,非常方便自定义

  •  
  •   hanxiV2EX ·
    hanxi · 2022-04-29 20:32:45 +08:00 · 3809 次点击
    这是一个创建于 737 天前的主题,其中的信息可能已经有所发展或是发生改变。

    比如自动读取 ssh 配置文件,加几行代码就行,用于管理远程主机,感觉比 xshell 那些 GUI 界面的更方便,支持模糊搜索主机。

    local wezterm = require "wezterm"
    
    local launch_menu = {}
    
    local ssh_config_file = wezterm.home_dir .. "/.ssh/config"
    local f = io.open(ssh_config_file)
    if f then
        local line = f:read("*l")
        while line do
            if line:find("Host ") == 1 then
                local host = line:gsub("Host ", "")
                table.insert(
                    launch_menu,
                    {
                        label = "SSH " .. host,
                        args = {"powershell.exe", "ssh", host}
                    }
                )
            end
            line = f:read("*l")
        end
        f:close()
    end
    
    return {
        launch_menu = launch_menu,
    }
    

    完整配置见: https://blog.hanxi.cc/p/82/

    1 条回复    2022-04-30 06:30:33 +08:00
    Kobayashi
        1
    Kobayashi  
       2022-04-30 06:30:33 +08:00 via Android
    完全没想到这么用…… 私用 ssh tab 补全或者配合 fzf 补全。
    终端上鉴于 wezterm 不支持字体字间距调整,咱是没有切换的打算。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   993 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 18:16 · PVG 02:16 · LAX 11:16 · JFK 14:16
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.