跳转到内容

tmux 集成

自 v0.10 起可用

使用 tmux 子命令,可以直接从运行中的 tmux 会话提取画面或历史记录并转换为 SVG。

在 tmux 会话中打开另一个窗口或窗格,也可以从外部 shell 运行。

Terminal
console2svg tmux capture -o tmux-current.svg

未指定 --target 时,会显示选择要捕获窗格的菜单。

样式选项的指定方式与 capture 模式相同。

Terminal
console2svg tmux capture -d macos-pc -t github-dark -o tmux-current.svg

使用 --target 指定目标窗格标识符。

Terminal
# 指定窗口 0 的窗格 1
console2svg tmux capture -o pane1.svg --target ":0.1"

如需同时捕获之前的输出,请用 --history 指定获取的行数。

Terminal
# 生成包含之前 100 行历史记录的捕获结果
console2svg tmux capture -o long-log.svg --history 100

不带参数时,会包含所有可获取的历史记录。

Terminal
console2svg tmux capture -o full-log.svg --history

也可以针对 tmux 窗格使用 live-server 功能。其参数与 live-server 相同。

Terminal
console2svg tmux live-server