Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Duplicated characters and non-updating input using tmux in zsh

First off: I'm using tmux 2.5 installed via homebrew on OS X 10.12, in iTerm 2 (though the problem appears in Terminal.app as well). My tmux.conf is on Github, along with my zshrc.

The problem: Seemingly out of nowhere, I started seeing an issue with typing in the prompt. Typing keys once will display them twice, and backspacing will move the cursor forward and redraw characters already present on the line. This only happens inside of a tmux session, and not inside my "regular" terminal.

Here's a gif of the issue. In this gif, I type 1234567890, then hit backspace 9 times, and type ls. Note that 0 only shows up once, and lls with a duplicated l runs the ls command as expected.

gif of weird input behavior

Hopefully I just hit a weird key combo on accident, but I've been stuck on this for a while.

Thanks for any help!

like image 604
taylor Avatar asked Oct 29 '22 02:10

taylor


1 Answers

I'm also running into this issue as well. I encountered the problem similar to @artemave, by trying to change the set -g default-terminal "screen-256color" to set -g default-terminal "tmux-256color". The goal of doing this was to gain italics, per the tmux FAQ.

@taylor's answer didn't work for me, as I didn't have that command.

I managed to determine that:

  1. The issue doesn't occur with bash

  2. When running a blank .zshrc, backspacing creates new blank lines, but I'm not seeing the character duplication

  3. Using tmux-256color will successfully give italic fonts

  4. Using TERM=xterm-256color and TERM=konsole-256color does not change the above effects

  5. Using xfce4terminal (0.8.9.1), Konsole (19.12.3), or URXVT (9.22) doesn't change the above behavior

I wasn't able to really "fix" the issue, as the even going down to a blank .tmux.conf wasn't able to change anything. Instead, I just needed to change it to anything else. xterm-256color was suggested in this issue, but I found nearly anything else would work fine.

I'll keep working on it and update this answer if I find anything else.

Edit: This tmux issue is the exact issue we're running into. I'll see if the solutions there work

https://github.com/tmux/tmux/issues/597

Edit 2: I've submitted a GitHub issue with tmux. No real results yet, but it does offer some guidance on things to check on.

like image 91
James Wright Avatar answered Nov 15 '22 10:11

James Wright