{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreihvnddy7ljh5bgf2u43mxdxud4sqdruxog2cw4vvornelvr6muoai",
"uri": "at://did:plc:aoqs4f5ru6ztomatyvept7bf/app.bsky.feed.post/3mnlsxptssr2q"
},
"canonicalUrl": "https://til.iainsimmons.com/posts/tmux-extended-keys-option-and-neovim-keymaps-with-modifiers",
"description": "today iain learned: how to enable the tmux extended-keys option and use it to add more Neovim keymaps with modifiers",
"path": "/posts/tmux-extended-keys-option-and-neovim-keymaps-with-modifiers",
"publishedAt": "2026-04-26T00:00:00.000Z",
"site": "at://did:plc:aoqs4f5ru6ztomatyvept7bf/site.standard.publication/3mnlsntqzp72a",
"tags": [
"terminal",
"CLI",
"tmux",
"Neovim"
],
"textContent": "Recently I switched back to using tmux, along with moving from WezTerm to Ghostty. This was mostly because WezTerm was becoming increasingly buggy, and didn't seem to be well maintained any longer (understandable, given how much a terminal emulator is expected to do these days). Also, I missed using sesh, my favourite tool for managing sessions in a terminal.\n\nOne thing that has bugged me about tmux, and in particular about using Neovim in tmux, is that some keymaps in Neovim seemed to just not work. They would often send other key presses or sequences, making them effectively useless. Once such example was trying to map <kbd>Ctrl</kbd> + <kbd>Space</kbd> to [[Upgrading to Neovim 0.12: built-in Undotree plugin, incremental selections|increment and decrement the visual selection using Treesitter]]. As far as I could tell, Neovim only received the <kbd>Space</kbd> key press.\n\nWhile watching a video on YouTube: [Pi: The Minimal Agent for REAL Devs from DevOps Toolbox][1], I saw one part of the Pi TUI that mentioned some keybinds that use modifier keys might not work without the extended-keys option in tmux. That was the first I had heard of it, so I started looking into it.\n\nI first found this helpful site and page: How to fix modifier key issues in tmux? - TmuxAI.\n\nGiven the \"AI\" in the site name, I of course validated it against the official docs: Modifier Keys on the tmux wiki.\n\nThe general gist of it is that you want to turn _on_ the extended-keys option, and also set additional terminal features to make sure they are passed on to the underlying terminal. I also have allow-passthrough set to on, as this generally seems to help with tmux compatibility with various terminal features and escape sequences.\n\nAnd the result is that I can now use Ctrl + Space as a keymap in Neovim:\n\nSo if there are any other keymaps you're using in Neovim (or other TUIs) from within tmux that just don't seem to work, try enabling the extended-keys option in your tmux configuration.\n\n[1]: https://youtu.be/OMFIPv8a4qA",
"title": "tmux extended-keys option and Neovim keymaps with modifiers"
}