Zellijのウェブ共有機能を少し試す

zellij logo small

ターミナルマルチプレクサ,ワークスペースのZellij 0.43.0が2025-08-05にリリースされていました.

気になる新機能としてウェブブラウザでZellijセッションを共有できるようになったようです.Tmateのような感じでしょうか?

Zellij 0.43.0のビルド

$ cargo install --locked zellij

でいいはずですが,sourceからも

$ git clone https://github.com/zellij-org/zellij (1)
$ cd zellij
$ git checkout v0.43.0 (2)
$ cargo xtask make -r (3)
  :
Could not find `protoc` installation and this build crate cannot proceed without (4)
Contthis knowledge. If `protoc` is installed and this crate had trouble finding
    it, you can set the `PROTOC` environment variable with the specific path to your11 [1,328 kB]
  :
$ sudo apt install protobuf-compiler (5)
$ cargo xtask make -r (6)
$ ./target/release/zellij --version (7)
zellij 0.43.0
  1. git でsourceをもらってくる

  2. v0.43.0 branchへ

  3. build

  4. protocが見つからないエラーで失敗

  5. protocはDebian sidではprotobuf-compilerなので導入

  6. 再度build

  7. バージョンの確認

Webサーバ機能を無効にするビルド例

ウェブサーバ機能が必要ない場合は –no-web を付けてビルドする
$ cargo xtask make -r --no-web
$ ./target/release/zellij web
This version of Zellij was compiled without web server support, cannot run web server!

CLIでWebサーバを起動

ウェブサーバ用トークンの作成
$ ./target/release/zellij web --create-token
Created token successfully

token_1: f964e7a4-0c8d-4652-b92f-23168161b3b4
トークンの一覧表示
$ ./target/release/zellij web --list-tokens
token_1: created at 2025-08-11 21:19:18
token_2: created at 2025-08-12 10:35:47
トークンの削除
$ ./target/release/zellij web --revoke-token token_1
Successfully revoked token.
Zellijウェブサーバ起動
$ ./target/release/zellij web
Web Server started on 127.0.0.1 port 8082

ウェブブラウザで http://127.0.0.1:8082/ に接続してトークンを入力してウェブブラウザでZellijが利用可能.

zellij web token
zellij web init
zellij web

結構普通に使えそうです.Zellijでは対応しているSixelはWeb版では未対応のようです.
ngrok経由でAndroidのFirefoxでも試してみるとモバイルブラウザでも動作するようです.でもキーボードとの相性がありそう.
sourceを見るとXterm.jsを利用しているようです.

Zellij上でウェブサーバを起動

Zellij起動中に Ctrl+o s で起動できます.
zellij share

設定でZellij起動時にいつもウェブサーバを起動するようにする

設定ファイルがない場合はディレクトリを作成して書き出し
$ mkdir ~/.config/zellij
$ zellij setup --dump-config > ~/.config/zellij/config.kdl
設定ファイルに web_server true を追記
5$ echo '// WebServer
> web_server true' | tee -a ~/.config/zellij/config.kdl

トンネリングサービスで外部から利用

トンネリングサービスのngrokでZellijのportを指定することで外部仮利用することもできました.

$ ngrok http 8082

好みの類似サービスでもきっと大丈夫です.

おわりに

TmuxフォークのTmateにも同じような機能がありますが,こちらはトンネリングサービスも含まれていたりhttpdだけでなくsshdも使えたり読み取り用セッション,読み書きセッションが選べたりと便利です.
でもUnux哲学的にはバラけていたほうがいいかなとか.それならZellij-nowebにWeb共有アプリ+トンネリングサービスのほうがいいのかなとか思ったりも.
何にせよ選択肢が増えたのは嬉しいですね.

環境
$ ./target/release/zellij --version
zellij 0.43.0
$ dpkg-query -W rustup
rustup  1.27.1-4
$ lsb_release -dr
Description:    Debian GNU/Linux forky/sid
Release:        n/a
$ arch
x86_64

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

To respond on your own website, enter the URL of your response which should contain a link to this post's permalink URL. Your response will then appear (possibly after moderation) on this page. Want to update or remove your response? Update or delete your post and re-enter your post's URL again. (Find out more about Webmentions.)