Looks like there's on open bug on this issue.

I was able to configure iTerm2 to use byobu locally on OS X as well as remotely over ssh on an Ubuntu 14.04 server.

Using:

  • OS X version: 10.9.5 Build 13F34
  • iTerm2 version: Build 1.0.0.20140629

First, in your OS X system preferences, edit your keyboard settings and remove or change any shortcut settings that may conflict with byobu (i.e. Ctrl + F1-F12).

Option 1: Workaround using escape sequences

Here's a workaround that will work without adding full functionality to the FN keys. This will allow you to split windows vertically using the byobu escape key:

  1. Start byobu.

  2. Set your desired Ctrl-A behavior by running: byobu-ctrl-a. I chose to go with Emacs-mode.

  3. Run byobu-config and choose or change your escape sequence. I went with the new default Ctrl + S. The F12 key is also an escape sequence

  4. Now you can issue a command with your escape sequence. Try F12 then % or Ctrl + sthen % to split a window vertically. For a full list of commands, try Ctrl + s then ? or F12 then ?.

Option 2: Setting iTerm2 key mappings to fully use all FN keys.

You can add some key mappings to your iTerm2 profile to get the CTRLALTSHIFT, and FNkeys to work with byobu. This is tedious, but I went through the exercise and it seems to work. I don't think there's an automated way to save these key mappings with iTerm2.

  1. Open iTerm2 preference and select Profiles.
  2. Choose the profile you'd like to use.
  3. Open the Terminal pane and under "Report terminal type" choose "linux".
  4. Open the Keys pane and manually add the following key bindings. Here's an example how to add one key binding:

    • Click the '+' icon.
    • Enter the keyboard shortcut being mapped in the first field. Example: CTRL + F2
    • Select "Send Escape Sequence" in the Action field.
    • Enter the characters in the third field. Example: [1;5Q

You can determine the control characters for any key sequence not listed here by referring to the tmux source code.

Repeat this for all of these mappings to make the corresponding byobu command work:

  • CTRL + F2 : [1;5Q
  • CTRL + SHIFT + F2 : [1;6Q
  • ALT + LEFT : [1;3D
  • ALT + RIGHT : [1;3C
  • ALT + UP : [1;3A
  • ALT + DOWN : [1;3B
  • CTRL + F3 : [1;5R
  • CTRL + F4 : [1;5S
  • CTRL + SHIFT + F3 : [1;6R
  • CTRL + SHIFT + F4 : [1;6S
  • SHIFT + ALT + LEFT : [1;4D
  • SHIFT + ALT + RIGHT : [1;4C
  • SHIFT + ALT + UP : [1;4A
  • SHIFT + ALT + DOWN : [1;4B
  • CTRL + F5 : [15;5~
  • CTRL + SHIFT + F5 : [15;6~
  • ALT + F6 : [17;3~
  • CTRL + F6 : [17;5~
  • ALT + PPAGE : [5;3~
  • ALT + NPAGE : [6;3~
  • CTRL + F8 : [19;5~
  • ALT + SHIFT + F8 : [19;4~
  • CTRL + SHIFT + F8 : [19;6~
  • CTRL + F9 : [20;5~
  • ALT + F11 : [23;3~
  • CTRL + F11 : [23;5~
  • ALT + F12 : [24;3~
  • CTRL + F12 : [24;5~
  • ALT + INS[2;3~

Summary

To get things to work we needed to:

  • Remove conflicts with OS X keyboard shortcuts.
  • Edit the terminal key mappings to send the correct escape sequences when using function keys.
  • Set the iTerm2 terminal type to "Linux", which sets the TERM environmental variable to be "linux". Byobu and/or Tmux seemed to be sensitive to this.

Some other references on escape sequences: SO link and xterm-keys.c


Default directory for new windows and panes

It looks like there are some difference in tmux window default directory between tmux 1.8 and tmux 1.9 (SrcSrcSrc). If you are using byobu with tmux 1.9 you can try adding this to your ~/.byobu/keybindings.tmux file so that when you create new windows or vertical/horizontal splits that they open in the same directory as the current pane:

unbind-key -n F2
bind-key -n F2 display-panes \; new-window -c "#{pane_current_path}" -n -
unbind-key -n C-F2
bind-key -n C-F2 display-panes \; split-window -hc "#{pane_current_path}"
unbind-key -n  S-F2
bind-key -n S-F2 display-panes \; split-window -vc "#{pane_current_path}"
unbind-key %
bind-key % display-panes \; split-window -hc "#{pane_current_path}"
unbind-key |
bind-key | display-panes \; split-window -vc "#{pane_current_path}"

Press F5 to reload settings.

Mac에서 저장한 파일명이 한글로 되어 있을경우

윈도에서 보면 자소가 분리 되어 보이는 경우가 있다.

이는 Windows와 Linux에서는 NFC 라는 유니코드(한글) 조합방식을 쓰는 반면에

Mac은 NFD라는 유니코드(한글) 조합방식을 쓰기 때문이다.

자세한건 다음 링크 참조



어째든 우리는 Mac서 저장한 NFD 파일명을 NFC형태의 파일명으로 바꿀려고 합니다.

방법은 그냥 python의 nfd2nfc 모듈을 쓰면 됩니다.

https://pypi.python.org/pypi/nfd2nfc/


그럼 nfd2nfc 설치 방법은 아래와 같습니다.

pip로 설치 되어야 하기 때문에 pip를 먼저 설치하고 nfd2nfc를 설치합니다.


커맨드창을 열고 하기 처럼 입력합니다.


$ sudo easy_install pip
$ sudo pip install nfd2nfc
$ nfd2nfc 경로명

또는 더 간단하게  convmv 로 할 수 있습니다. 

$ convmv --notest -nfc -f utf8 -t utf8 파일명

PS. MAC에서 둘다 설치가 가능하지만 nfc로 파일명이 바뀌지 않습니다.

이유는 FileSystem Layer에서 NFD만 지원하도록 되어 있기 때문이라고 합니다.

다만 콘솔에서 파일명 출력은 각각 NFD와 NFC로 할수 있습니다. (실제 파일명 저장이 아닌 텍스트 출력)

MAC에서 한글이 NFD인지 NFC인 확인하기 가장 쉬운 방법은 SublimeText에 붙여 넣어보면 됩니다.

SublimeText는 NFD를 지원하지 않습니다.