統合シェルやインライン画像機能で便利になった「iTerm2 v3」を使ってみた。

Mac
記事内に広告が含まれています。
スポンサーリンク
スポンサーリンク
スポンサーリンク

 統合シェルや画像のインライン展開機能で便利になった「iTerm2 v3」を少し使ってみました。詳細は以下から。

iTerm2-v3-Hero

 現在Beta版として公開中のMac用ターミナルエミュレータアプリiTerm2 v3にはiTerm2 v2には無い統合シェル機能やインライン画像表示機能など面白い機能が実装されているそうなので、早速利用してみました。

インライン画像

 iTerm2は現在v3のベータ版のv2.9から画像のls「imgls」や画像のcat「imgcat」に対応しており、公式サイトで配布されているスクリプトを実行することで以下の様な画像のインライン表示が可能です。(*v 2.9.20150512 からはアニメーションGIFにも対応しています)

iTerm2 is able to display images within the terminal. Using a similar mechanism, it can also facilitate file transfers over any transport (such as ssh or telnet), even in a non-8-bit-clean environment.Inline images and file transfers are only available in iTerm2 version 2.9 and later. It is not in 2.1.1.

Images – iTerm2 – Mac OS Terminal Replacement

 imglsやimgcatはxtermプロトコルを拡張したスクリプトで、公式サイトには幾つかのサンプルコードも用意されており、ユーザーは各自でインライン画像表示スクリプトを作成することが可能なので、Gnuplotで作成したグラフの表示やTwitterクライアントにも利用できそうです。

Shell Integration(統合シェル)

 iTerm2 v3には「Shell Integration」という機能が追加できるようになっており、[iTerm2]メニューか以下のコマンドで「install_shell_integration.sh」をダウンロードし実行してやることにより以下で紹介する機能を利用することが出来ます。(常用する場合は”.bash_profile”などへ追加)

iTerm2-v3-install-shell-integration

curl -L https://iterm2.com/misc/install_shell_integration.sh | bash

マーク&注釈

 マーク機能はOS X 10.11 El Capitanのターミナルアプリにも実装されている機能で、マーク(Shift + Cmd + M)したラインに素早く移動(Shift + Cmd + ↑/↓)することが可能です。

 *マークはiTerm2 v2でも利用できますが、v3ではマークの他に注釈挿入機能も利用できるようになっており、カーソル行にマーク+注釈を付ける事ができます。

ツールベルト

 ツールベルトは現在実行中のジョブやノートを表示できるウィンドウで、v2から用意されていましたが、v3では新たに出力のキャプチャーや履歴、移動ディレクトリなどを表示し、

  • Captured Output (New)
  • Command History (New)
  • Jobs
  • Notes
  • Paste History
  • Profiles
  • Recent Directories (New)

Easy access to recently and frequently used directories.

iTerm2 remembers the directories you use, sorting them by “frecency” and giving you access to them in the toolbelt and in a popup window.

Shell Integration – iTerm2 – Mac OS Terminal Replacement

 ツールベルトから素早くアクセスしたり、ジョブの再実行、killなどが簡単に行なえます。

iTerm2-v3-Toolbelt

アラート

 アラート機能は長期のジョブが終了した場合、ジョブ終了を通知してくれる「terminal-notifier」の様な機能で、「アラートボックス」か「通知センター」で通知をしてくれます。

Alert on next mark

iTerm2 can show an alert box when a mark appears. This is useful when you start a long-running command. Select Edit>Alert on next mark (Cmd-Opt-A) after starting a command, and you can go do something else in another window or tab. When the command prompt returns, a modal alert will appear, calling attention to the finished job.

Shell Integration – iTerm2 – Mac OS Terminal Replacement

 アラート機能は[Edit] > [Marks and Annotations] > [Alerts]かショートカットキー(Cmd + Opt + A)で設定でき、設定されるとiTerm2の右上にEyeマークが表示されます。

コマンドステータス

 コマンドステータスは実行に失敗したコマンドや実行ディレクトリ、時間、コードを表示したり、コマンドの再実行や出力の一括セレクトなどが可能なコンテクストメニューです。

iTerm2-v3-Command-Info

Command status

The mark on a command line will turn red if a command fails. You can right click the mark to view its return code.

Shell Integration – iTerm2 – Mac OS Terminal Replacement

 追加された機能の多さと時間の関係上、全ての機能を紹介することは出来ませんが、Beta段階でも安定しているので、ターミナルで物足りない方は公式サイトからBeta版をダウンロードして利用してみてください。

関連リンク

コメント

  1. Apple7743 より:

    imglsとlmgcatだけの為にダウンロードしたら、key-value で表示サイズとか変えられて予想以上に使えるぞこれ!

  2. Apple7743 より:

    そして理想のターミナルフォントを夢見る日々。

  3. Apple7743 より:

    *2
    日本語も使うならSource Han Code JPがお勧め

  4. Apple7743 より:

    自分の理想はDECの漢字ターミナルフォントなわけですが誰かデータ化してくれないものか。あの辺は今どこに権利があるんだろう。

  5. Apple7743 より:

    decの漢字フォントって見た事ないけど、サンプル画像とかある?
    sonyとかsunのワークステーションで使ってたよくあるフォントじゃ無くて?

タイトルとURLをコピーしました