views:

57

answers:

2

Hi, I have a problem with TMUX key bindings. When I'm working on a terminal pane, if I press ctrl+pgup, it should scroll the screen one page up, as a normal terminal, but it doesn't.

Also, while using VIM, I have mapped to do some actions, but this key combination is not called.

Any TMUX expert there?.

A: 

Be sure that your shell and terminal are sending the appropriate escape sequences to one-another to indicate non-alphanumeric keys. For example, I use tmux with zsh in urxvt. I had quite a few problems with keys acting inappropriately (like enter insert mode and adding [3~) until I made sure my shell was communicating the appropriate key-bindings with:

# .zshrc
bindkey '\e[1~' beginning-of-line
bindkey '\e[4~' end-of-line
bindkey '\e[6~' down-line-or-search
bindkey '\e[5~' up-line-or-search
bindkey '\e[3~' delete-char

If this is your problem, yours are not likely to be the same, but you should be able to find resources specific to your shell and terminal emulator.

sleepynate
I too use zsh, with gnome-terminal, and I also have those key bindings. Without tmux the terminal works correctly, that's why I think my problem should be solved by modifying my .tmux.conf (but I don't know how).
Leonardo M. ramé
oh interesting. I'll have to keep thinking :)
sleepynate
+1  A: 

use the tmux command setw -g xterm-keys on

you may also need to add this to your ~/.vimrc

if &term == "screen"
    set t_kN=^[[6;*~
    set t_kP=^[[5;*~
endif
sleepynate
Thanks again sleepynate, but it does not work. In VIM, when I press ctrl+pgup, instead of moving to previous tab, the text is changed to Upper Case. Also, in the zsh shell, when I press ctrl+pgup, a "~5" is shown.
Leonardo M. ramé
I must add, in my ~/.zshrc I have "bindkey -e"
Leonardo M. ramé
http://wiki.archlinux.org/index.php/Zsh#Key_Bindings <--- and you have all of these set?
sleepynate
Sleepynate, I added them to my .zshrc, but gave up on TMUX, I replaced it by Terminator.
Leonardo M. ramé