# Weird tmux behaviour when inserting text



## serpent7776 (Oct 20, 2015)

I'm currently using x11/xterm+sysutils/tmux but I have exact same issues as described here:
https://bugs.launchpad.net/terminator/+bug/1427619
In short: inserting text in the middle of commandline looks like overwrite instead of insert.

I already found that I had this in my ~/.chsrc:

```
setenv TERM xterm-clear
```
which probably caused this issue, but I'm not sure If this is a bug or expected behaviour?


----------



## xtaz (Oct 21, 2015)

This problem drove me nuts for months until I worked out how to fix it. My SSH terminal is set to xterm-256color and in my sysutils/tmux config file I had set-option -g default-terminal "xterm-256color". This caused the problem you mention. I fixed it by changing the config to say set-option -g default-terminal "screen-256color" instead. I guess the term needs to use specific screen escape codes instead of the normal xterm ones?


----------



## freethread (Oct 22, 2015)

I have this configuration too, I do not remember why, perhaps the mouse in misc/mc


----------



## serpent7776 (Oct 26, 2015)

Just to note: I had this issue on localhost, not via ssh. When I try to check value of `default-terminal` inside of tmux it says `Empty value`


----------

