Description of problem: When running tmux with TERM=putty[-256color] left/right arrows do not work inside. Version-Release number of selected component (if applicable): tmux-2.2-1.fc24.x86_64 How reproducible: Always. Steps to Reproduce: 1. Installed Fedora-Server 24 as a guest. 2. Connected from Windows with Putty 0.67 via ssh. 3. dnf install tmux 4. tmux 5. While typing commands cursor arrow keys up/down work, left/right don't. Actual results: $ echo $TERM putty-256color $ cat -vT <pressing up, down, right, left, ^C here> ^[[A^[[B^[[C^[[D^C $ tmux $ echo $TERM screen $ cat -vT <pressing up, down, right, left, ^C here> ^[[A^[[B^C $ exit $ TERM=xterm-256color tmux $ echo $TERM screen $ cat -vT <pressing up, down, right, left, ^C here> ^[[A^[[B^[[C^[[D^C $ Expected results: Should have seen ^[[A^[[B^[[C^[[D^C output for each cat -vT. Additional info: While using xterm-256color helps with tmux somewhat it breaks other funcionality, so can't be considered a fix. Comparing 'infocmp -1 putty' output between fedora 23 and 24 reveals: --- 23putty 2016-08-22 13:27:55.285713815 +0000 +++ 24putty 2016-08-22 13:26:31.376164245 +0000 @@ -55,13 +55,15 @@ indn=\E[%p1%dS, initc=\E]P%p1%x%p2%{255}%*%{1000}%/%02x%p3%{255}%*%{1000}%/%02x%p4%{255}%*%{1000}%/%02x, is2=\E7\E[r\E[m\E[?7h\E[?1;4;6l\E[4l\E8\E>\E]R, + kLFT=\E[D, + kRIT=\E[C, kb2=\E[G, kbs=\177, kcbt=\E[Z, - kcub1=\E[D, - kcud1=\E[B, - kcuf1=\E[C, - kcuu1=\E[A, + kcub1=\EOD, + kcud1=\EOB, + kcuf1=\EOC, + kcuu1=\EOA, kdch1=\E[3~, kend=\E[4~, kf1=\E[11~, @@ -86,9 +88,11 @@ kf9=\E[20~, khome=\E[1~, kich1=\E[2~, + kind=\E[B, kmous=\E[M, knp=\E[6~, kpp=\E[5~, + kri=\E[A, kspd=^Z, nel=^M^J, oc=\E]R, @@ -101,6 +105,7 @@ rmam=\E[?7l, rmcup=\E[2J\E[?47l, rmir=\E[4l, + rmkx=\E[?1l\E>, rmpch=\E[10m, rmso=\E[27m, rmul=\E[24m, @@ -117,6 +122,7 @@ smam=\E[?7h, smcup=\E[?47h, smir=\E[4h, + smkx=\E[?1h\E=, smpch=\E[11m, smso=\E[7m, smul=\E[4m, Seems like there has been some wrong changes to terminfo db in ncurses package.
Here is upstream discussion that led to this change in the putty terminfo: https://lists.gnu.org/archive/html/bug-ncurses/2016-01/msg00010.html Does the problem happen when not in tmux?
Interesting. Testing with TERM=putty shows following: 1) 'cat -vT' shows that terminal sends \E[A .. \E[D by default, \E0A .. \E0D when holding shift and/or ctrl. 2) Outside of tmux arrows work fine in vim, nano, mc, bash, zsh, psql. 3) Inside tmux they still work fine in vim, nano, mc, but left/right does not work in bash, zsh and psql. 4) Holding shift and/or control inside tmux makes left/right arrows work. Using TERM=putty-noapp fixes readline programs inside tmux. I don't understand why up/down works but left/right doesn't. And can't decide what to blame - updated terminfo in ncurses, GNU readline not using application mode properly or tmux which exhibits weird behavior. Also zsh deserves seperate bug for broken home/end keys.
Upon reading http://git.suckless.org/st/plain/FAQ I've created ~/.inputrc with 'set enable-keypad on' line, and ~/.zshrc with: function zle-line-init () { echoti smkx } function zle-line-finish () { echoti rmkx } zle -N zle-line-init zle -N zle-line-finish This have fixed the original issue, though home/end are still broken in zsh.
I personally ended up getting an older version of the terminfo files from Ubuntu 14.04 (ncurses-term 5.9+20140118) and plopped them in-place over the newer ones (Fedora 24, ncurses-term 6.0-6.20160709) and everything works as usual. I personally feel workarounds are not acceptable solutions and the older version of the PuTTY terminfos shoud be used instead of the newer upstream one for the time being.
I have this exact problem on Fedora 25 still, the only workarounds are an old terminfo file, or using keypad on, in inputrc. The keypad solution is non-workable as it means that every single server I SSH into must have this setup.
This is an issue in tmux, and was fixed in tmux 2.4
Created attachment 1286471 [details] fix for the application keys in tmux The attached patch is a cherry-pick onto the 2.2 tag of tmux, which we should be able to backport and include to fix this issue in the tmux-2.2 source for Fedora 25.
Created attachment 1286472 [details] updated SRPM package for Fedora 25 I took the liberty of downloading the fedora 25 SRPM for tmux (tmux-2.2-3.fc25.src.rpm) and adding in the patch file that fixes the issue. Hopefully this helps the package owner out.
Thanks, fixed in F25, please test the package and give some karma. https://src.fedoraproject.org/cgit/rpms/tmux.git/commit/?h=f25&id=0bf7d3667f82ba32d3f9fcc8b058236e96fb3cd9 https://koji.fedoraproject.org/koji/taskinfo?taskID=19942757
tmux-2.2-4.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2017-094433a33e
tmux-2.2-4.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-094433a33e
tmux-2.2-4.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.
This wasn't fixed upstream until tmux 2.5 so the same fix needs to be backported into the 2.3 package in Fedora 26.
I'm planning to update tmux on F26 to latest 2.5 release (already on rawhide). Since F26 will be supported for at least 13 months I think it's the better approach.
Created attachment 1297814 [details] Fedora 26 SRPM This uses the exact same patch for the Fedora 25 2.2 build.
That's fine. I rebuilt a 2.3-3 version you can provide now or wait for the 2.5 update. I can easily use this 2.3-3 version locally until an update is provided.
Created attachment 1297815 [details] fixed Fedora 26 SRPM The first attachment forgot to actually apply the patch.
tmux-2.5-1.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-e9083815d8
tmux 2.5 available on Fedora 26, testing needed.
tmux-2.5-1.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-e9083815d8
This works for me in Fedora 26
tmux-2.5-1.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report.