コンテンツにスキップ

tmux連携

v0.10 で導入

tmux サブコマンドを使用することで、実行中のtmuxセッションから画面や履歴を直接吸い出してSVG化できます。

tmux セッション内で別ウィンドウやペインを開くか、外側のシェルから実行します。

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