neomutt / neomutt

✉️ Teaching an Old Dog New Tricks -- IRC: #neomutt on irc.libera.chat
https://neomutt.org/
GNU General Public License v2.0
3.2k stars 307 forks source link

CTRL modifier keybindings not working in TMUX #3971

Closed tjex closed 1 year ago

tjex commented 1 year ago

Expected Behaviour

navigate sidebar with:

bind index,pager \Cl sidebar-open
bind index,pager \Ck sidebar-prev
bind index,pager \Cj sidebar-next

Actual Behaviour

Inside TMUX: No navigation is achieved. Nothing happens. i.e. the selector does not move in the sidebar, and the initial sidebar item cannot be opened.

Outside TMUX: Works as expected.

Steps to Reproduce

add to muttrc:

bind index,pager \Cl sidebar-open
bind index,pager \Ck sidebar-prev
bind index,pager \Cj sidebar-next

here is my full muttrc

tmux.conf:

setw -g mouse on

# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'christoomey/vim-tmux-navigator'

# Other examples:
# set -g @plugin 'github_username/plugin_name'
# set -g @plugin 'github_username/plugin_name#branch'
# set -g @plugin 'git@github.com:user/plugin'
# set -g @plugin 'git@bitbucket.com:user/plugin'

unbind C-b
unbind Left
unbind Right

set-option -ga terminal-overrides ",xterm-256color:Tc"
set-option -g prefix C-a
bind-key C-a send-prefix
set -sg escape-time 5

set -g xterm-keys on
set -g status-style "bg=#202436 fg=#a6864d"
set -g pane-border-style "fg=#202436"
set -g pane-active-border-style "bg=default fg=#202436"

set-window-option -g mode-keys vi
bind -T copy-mode-vi v send-keys -X begin-selection
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'xclip -in -selection clipboard'

bind -r ! run-shell "tmux neww ~/.local/scripts/utility/cht.sh"
bind -r @ run-shell "tmux neww nvim ~/tjroot/notes/scrapbook.md"
bind -r & kill-pane
bind -r | confirm kill-window
bind -r c new-window -c "#{pane_current_path}"
bind -r y copy-mode
bind -r [ previous-window
bind -r ] next-window
bind -r w last-window
bind -r s switch-client -l
bind -r e choose-tree -Zs
bind -r h select-pane -L
bind -r l select-pane -R

# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.local/share/tmux/plugins/tpm/tpm'

How often does this happen?

When did it start to happen?

When I started using neomutt in tmux.

NeoMutt Version

NeoMutt 20230517
Copyright (C) 1996-2022 Michael R. Elkins and others.
NeoMutt comes with ABSOLUTELY NO WARRANTY; for details type 'neomutt -vv'.
NeoMutt is free software, and you are welcome to redistribute it
under certain conditions; type 'neomutt -vv' for details.

System: Darwin 22.6.0 (arm64)
ncurses: ncurses 6.4.20221231 (compiled with 6.4.20221231)
libiconv: 1.11
libidn2: 2.3.4 (compiled with 2.3.4)
GPGME: 1.20.0
OpenSSL: OpenSSL 3.1.1 30 May 2023
libnotmuch: 5.6.0
PCRE2: 10.42 2022-12-11
storage: tokyocabinet, lmdb
compression: zlib

Configure options: --prefix=/opt/homebrew/Cellar/neomutt/20230517_1 --sysconfdir=/opt/homebrew/etc --autocrypt --gss --disable-idn --idn2 --lmdb --nls --notmuch --pcre2 --sasl --sqlite --tokyocabinet --zlib --with-lua=/opt/homebrew/opt/lua --with-ncurses=/opt/homebrew/opt/ncurses --with-ssl=/opt/homebrew/opt/openssl@3 --with-sqlite=/opt/homebrew/opt/sqlite

Compilation CFLAGS: -D_ALL_SOURCE=1 -D_GNU_SOURCE=1 -D__EXTENSIONS__ -D_XOPEN_SOURCE_EXTENDED -I/opt/homebrew/opt/libgpg-error/include -I/opt/homebrew/Cellar/libassuan/2.5.6/include -I/opt/homebrew/Cellar/gpgme/1.20.0/include -I/opt/homebrew/Cellar/neomutt/20230517_1/include -I/opt/homebrew/include/lua -I/opt/homebrew/Cellar/neomutt/20230517_1/include -I/opt/homebrew/Cellar/neomutt/20230517_1/include -I/opt/homebrew/opt/sqlite/include -I/opt/homebrew/Cellar/neomutt/20230517_1/include -DNCURSES_WIDECHAR -I/opt/homebrew/Cellar/neomutt/20230517_1/include -I/opt/homebrew/Cellar/openssl@3/3.1.1/include -I/opt/homebrew/Cellar/libidn2/2.3.4_1/include -I/opt/homebrew/Cellar/pcre2/10.42/include -I/opt/homebrew/opt/lmdb/include -I/opt/homebrew/Cellar/tokyo-cabinet/1.4.48/include -I/opt/homebrew/Cellar/neomutt/20230517_1/include

Default options:
  +attach_headers_color +compose_to_sender +compress +cond_date +debug
  +encrypt_to_self +forgotten_attachments +forwref +ifdef +imap +index_color
  +initials +limit_current_thread +multiple_fcc +nested_if +new_mail +nntp +pop
  +progress +quasi_delete +regcomp +reply_with_xorig +sensible_browser +sidebar
  +skip_quoted +smtp +status_color +timeout +tls_sni +trash

Compile options:
  +autocrypt +fcntl -flock -fmemopen +futimens +getaddrinfo -gnutls +gpgme
  -gsasl +gss +hcache -homespool +idn -inotify -locales_hack +lua -mixmaster
  +nls +notmuch +openssl +pcre2 +pgp +sasl +smime +sqlite +sun_attachment

MAILPATH="/var/mail"
PKGDATADIR="/opt/homebrew/Cellar/neomutt/20230517_1/share/neomutt"
SENDMAIL="/usr/sbin/sendmail"
SYSCONFDIR="/opt/homebrew/etc"

Extra Info

I checked bindings for my terminal emulator (wezterm) for any ctrl-j/k/l conflicts. There were none. I checked the problem in built in mac terminal - same problem.

CTRL- bindings in other applications such as neovim work fine in tmux (also specifically C-j and C-k, which I have mapped to navigate horizontal splits in neovim)

jindraj commented 1 year ago

Hello @tjex,

I'd blame the vim-tmux-navigator plugin. Perhaps it needs some configuration changes, but this is more tmux or better said the vim-tmux-navigator plugin question then a neomutt one.

Try running :exec what-key in neomutt and press the keys of affected bindings to see what neomutt is receiving if anything.

tjex commented 1 year ago

yup. you were right... well seen!