iTerm2 設定
このページでは、iTerm2の設定に関する情報を提供しています。
tmux との統合機能を中心に、ターミナル作業を効率化するためのさまざまなカスタマイズ方法を紹介します。
tmux 統合
Section titled “tmux 統合”iTerm2で tmux 統合を使用すると、tmux のウィンドウをタブやウィンドウとして簡単に管理できます。
また、新しいタブを開いたり、画面を分割したりする操作を、tmux の特別なコマンドを覚えなくても、iTerm2のメニューやショートカットを使って簡単に行うことができます。

プロフィール設定
Section titled “プロフィール設定”Profiles の Command で Command を選択し、以下の設定を行う。
ssh -t <接続先> 'tmux -CC new -As main'General の tmux から設定を行う。
When attaching, restore windows as
Section titled “When attaching, restore windows as”| 設定 | 説明 |
|---|---|
| Native Windows | tmux のウィンドウが iTerm2 のネイティブウィンドウとして復元される。 |
| Native Tabs in a New Window | tmux のウィンドウが新しい iTerm2 ウィンドウ内のタブとして復元される。 |
| Tabs in the Attaching Window | tmux のウィンドウが現在アタッチしているウィンドウ内のタブとして復元される。 |
- デフォルト: Native Windows
- 推奨: Native Tabs in a New Window
Automatically bury the tmux client session after connecting
Section titled “Automatically bury the tmux client session after connecting”このオプションを有効にすると、tmux セッションに接続した際に、tmux クライアントセッションが自動的に非表示になる。
- デフォルト: OFF
- 推奨: ON
Use “tmux” profile rather than profile of the connecting session
Section titled “Use “tmux” profile rather than profile of the connecting session”この設定を有効にすると、tmux 統合セッションで使用されるプロファイルが、接続先のセッションのプロファイルではなく、フォルトプロファイルのコピーとして作成される「tmux」プロファイルを使用する。
- デフォルト: ON
- 推奨: OFF
Status bar shows tmux status bar content, not native components
Section titled “Status bar shows tmux status bar content, not native components”iTerm2 のステータスバーに tmux のステータスバーの内容が表示される。
- デフォルト: ON
- 推奨: ON
Warn before pausing
Section titled “Warn before pausing”tmux セッションが一時停止する前に警告を表示する。
- デフォルト: OFF
- 推奨: ON
Unpause automatically
Section titled “Unpause automatically”tmux セッションが一時停止した後、自動的に再開する。
- デフォルト: OFF
- 推奨: ON
Mirror tmux paste buffer to local clipboard
Section titled “Mirror tmux paste buffer to local clipboard”tmux のペーストバッファの内容をローカルのクリップボードにミラーリングする。
- デフォルト: OFF
- 推奨: ON
”Remember my choice” チェックボックスの選択変更方法
Section titled “”Remember my choice” チェックボックスの選択変更方法”Advanced 設定で “Suppress alert asking what kind of tab/window to open in tmux integration” を検索し、出てきた項目をすべて “NO” に設定する。
プロファイルのおすすめ設定
Section titled “プロファイルのおすすめ設定”General
Section titled “General”ターミナルセッションの右上に表示される大きなテキストラベルの設定。
- 推奨: 環境名
Window
Section titled “Window”Transparency
Section titled “Transparency”ウィンドウの透明度の設定。
- 推奨: 10
ウィンドウのぼかしの設定。
- 推奨: 15
Use Transparency
Section titled “Use Transparency”ウィンドウの透明度の有効化設定。
- 推奨: ON
Terminal
Section titled “Terminal”Terminal Emulation
Section titled “Terminal Emulation”Enable mouse reporting
Section titled “Enable mouse reporting”ターミナル内でマウスの動きやクリックをアプリケーションに通知する機能。
- デフォルト: ON
- 推奨: OFF
Notifications
Section titled “Notifications”Silence bell
Section titled “Silence bell”ターミナルでの操作中に発生するビープ音を無効にする設定。
- 推奨: ON
Flash visual bell
Section titled “Flash visual bell”ビープ音の代わりに視覚的な通知を提供する機能。
- 推奨: ON
Session
Section titled “Session”Show timestamps
Section titled “Show timestamps”各行のタイムスタンプを表示する設定。これにより、コマンドの実行時刻やメッセージの表示時刻を確認できる。
| 設定 | 説明 |
|---|---|
| Off | オフ |
| Always | 常に表示 |
| When mouse hovers over scroll bar | マウスオーバー時に表示 |
- 推奨: When mouse hovers over scroll bar