• home
  • about
  • 全ての投稿
  • ソフトウェア・ハードウェアの設定のまとめ
  • 分析関連のまとめ
  • ヘルスケア関連のまとめ
  • 生涯学習関連のまとめ

byobu

date: 2021-09-11 excerpt: byobuの使い方

tag: byobutmuxscreen


byobuの使い方

概要

  • tmux, screenのラッパー
  • tmuxとは別にterminal multiplexerを起動したいときなどに用いることができる
    • e.g. 一部のterminal emulatorはタブをサポートしないのでタブの代わりに用いる

インストール

ubuntu

$ sudo apt install screen byobu

osx

$ brew install screen byobu

基本的なコマンド

  • F2; Create a new window
  • F3; Move to the previous window
  • F4; Move to the next window
  • F5; Refresh all status notifications
  • F6; Detach from the session and logout
  • F8; Rename the current window

バックエンドの設定

  • tmuxかscreenを選べる
$ byobu-select-backend
Select the byobu backend:
  1. tmux
  2. screen

Choose 1-2 [1]: <入力>

screenバックエンド時

configファイルの設定

設定ファイルのパス

  • ~/.byobu/keybindings

設定の追加・編集

source $BYOBU_PREFIX/share/byobu/keybindings/common

bindkey "^[[1;2D" eval 'prev' 'fit'                   # shift-left   | Previous Window
bindkey "^[[1;2C" eval 'next' 'fit'                   # shift-right  | Next Window
bindkey "ç" $BYOBU_BACKEND                            # option+c | Create new window
bindkey "∂" detach                                    # option+d  | Detach from this session

バインドキーのキーコードの調べ方

  • vimを起動してinsert modeにして, ctrl+vでraw input modeにする
  • ここでコマンドの組み合わせを入力するとraw文字列で入力されるので判明する

screenのコマンドを使う

  • ctrl+a + dでdetachできるなど、screenのコマンドを使用することもできる

tmuxバックエンド時

マルチプレクサをネストして使おうとするときは、tmuxバックエンドのほうが向いている

configファイルの設定

設定ファイルのパス

  • ~/.byobu/keybindings.tmux

設定の追加・編集

unbind -n S-Right					# ネスト時の干渉を防ぐ
unbind -n S-Left					# ネスト時の干渉を防ぐ
bind-key -n C-[ previous-window		# Ctrl+<-で前のwindowへ
bind-key -n C-] next-window			# Ctrl+->で次のwindowへ


byobutmuxscreen Share Tweet