超级强大的终端模拟器-rust开发的支持gpu渲染采用lua配置的多路复用模拟器

作者: dreamfly 分类: software 发布时间: 2022-10-13 11:37

对于后端开发人员来说,每天接触最多的就是终端了,而一款趁手的工具对于工作效率来说至关重要,可以起到事半功倍的效果。

wezterm

wezterm

wezterm就是一款不可多得非常好用的终端模拟器,它支持多标签,支持分屏,支持多窗口,支持鼠标,支持多种配色方案,它采用的是lua进行配置,因此非常灵活,而且最重要的一点就是它的文档非常全面,这相比于其它模拟器来说是一个亮点。

可以说基本上你可以想到的配置,它都可以实现,出色的外观加上不错的性能,让它成为了很多人都爱不释手的软件。

下面是一些它的基本配置:

local wezterm = require 'wezterm'
return {
  font = wezterm.font_with_fallback {
    'Fira Code',
    'DengXian',
  },
  leader = { key = 'a', mods = 'CTRL', timeout_milliseconds = 1000 },
  keys = {
    {
      key = '|',
      mods = 'LEADER|SHIFT',
      action = wezterm.action.SplitHorizontal { domain = 'CurrentPaneDomain' },
    },
    -- Send "CTRL-A" to the terminal when pressing CTRL-A, CTRL-A
    {
      key = 'a',
      mods = 'LEADER|CTRL',
      action = wezterm.action.SendString '\x01',
    },
  },
  mouse_bindings = {
    -- Right click sends "woot" to the terminal
    {
      event = { Down = { streak = 1, button = 'Right' } },
      mods = 'NONE',
      action = act.SendString 'woot',
    },

    -- Change the default click behavior so that it only selects
    -- text and doesn't open hyperlinks
    {
      event = { Up = { streak = 1, button = 'Left' } },
      mods = 'NONE',
      action = act.CompleteSelection 'PrimarySelection',
    },

    -- and make CTRL-Click open hyperlinks
    {
      event = { Up = { streak = 1, button = 'Left' } },
      mods = 'CTRL',
      action = act.OpenLinkAtMouseCursor,
    },
    -- NOTE that binding only the 'Up' event can give unexpected behaviors.
    -- Read more below on the gotcha of binding an 'Up' event only.
  },
  color_scheme = 'Red Scheme',

  color_schemes = {
    ['Red Scheme'] = {
      background = 'red',
    },
    ['Blue Scheme'] = {
      background = 'blue',
    },
  },
}

下面是它的特性,更多的使用方法可以参考官方手册

  • 可以在Linux、macOS、Windows 10和FreeBSD上运行
  • 本地和远程主机上的多路终端窗格、选项卡和窗口,带有本机鼠标和滚动条
  • 连字、颜色表情符号和字体回退,具有真彩色和动态配色方案。
  • 支持超链接点击
  • 可搜索滚动(使用鼠标滚轮和Shift PageUp和Shift PageDown导航,Ctrl-Shift-F激活搜索模式)
  • 用鼠标选择文本的xterm样式;通过Shift Insert选择粘贴(支持带括号的粘贴!)
  • SGR风格的鼠标报告(适用于vim和tmux)
  • 渲染下划线、双下划线、斜体、粗体、删除线(大多数其他终端模拟器不支持如此多的渲染属性)
  • 通过热重新加载的配置文件进行配置
  • 多窗口(热键:Super-N)
  • 拆分/窗格(水平/垂直拆分:Ctrl-Shift-Alt-%和Ctrl-Shift-Alt-“,在窗格之间移动:Ctrl-SShift ArrowKey)
  • 选项卡(热键:超级-T,下一个/上一个:超级Shift-[和超级Shift-],转到:超级-[1-9])
  • 带有本机选项卡的SSH客户端
  • 连接到串行端口以进行嵌入式/Arduino工作
  • 通过unix域套接字连接到本地多路复用服务器
  • 通过TCP/IP使用SSH或TLS连接到远程多路复用器
  • iTerm2兼容图像协议支持,内置imgcat命令
  • Kitty图形支持
  • Sixel图形支持

如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!