Byobu has some keybindings that require a modifier key and a function key, like Shift+f2 or Ctrl+f7. Unfortunately macOS picks these up instead and does god knows what with them. How do I send these key combinations to iTerm2?
I had exactly the same issue and it seems to have been solved in the latest iTerm2. But if your profile was created before the fix like mine, a little configuration is needed:
- Go to Preferences -> Profiles -> <Your Profile> -> Terminal, make sure 'Report terminal type' is set to
- Go to Preferences -> Profiles -> <Your Profile> -> Keys, click Presets -> xterm Defaults
You can disable shortcuts used by MacOS. To do this:
- Open System Preferences (under the Apple menu)
- Select Keyboard
- Click Shortcuts
Here you'll see several sets of shortcuts you can toggle. The two lists you'll want to look at are Mission Control and Keyboard. Uncheck anything that uses a function key. Your various function keys should now work inside Byobu.
You can change whether you have to hold Fn to use a function key. Under the Keyboard tab, check "Use F1, F2, etc. keys as standard function keys."
While you're in the shortcuts tab, you might scroll around and see what other shortcuts MacOS has to offer. You might see something useful to you or notice another keyboard shortcut that's been getting in your way.
I have manually configured key mappings on iTerm2 for Byobu, the profile json is available here which you can import and use.
Shift + F2 - Horizontal split Ctrl + F2 - Vertical split Shift + Arrow keys - Move across splits Alt + → or ← - Move across windows Alt + ↑ or ↓ - Move across sessions Shift + F11 - Zoom in/out a (split) window