Configuring function keys in PuTTY for both Vim and Midnight Commander under tmux?

Solution 1:

The problem is the TERM=xterm outside tmux. There is no configuration of PuTTY which matches the xterm terminal description, and the mismatch feeds into screen or tmux (take your pick).

See for example, in the ncurses FAQ Why not just use TERM set to "xterm"?. The recommendation there is of course to set

TERM=putty

A quick check using tack shows that this combination (TERM=putty, tmux) works for Ubuntu 14.04 (you should have installed the ncurses-term package, which includes this).