0

I've got debian and when I'm in tmux, sometimes my input is taken literally. (FWIW I ssh into this computer.)

For instance, I was earlier doing:

sudo apt-get remove ftp

And when It would ask for y/n, I could input the letters just fine. But when I hit enter, I would get "^M^ instead. When I hit delete, I got "^?" instead.

When I closed tmux, everything worked just fine, and I could uninstall ftp.

Does anyone know why this is / how to fix it?

EDIT: This also happens when I am running code I've written in c++ and use std::cin. In tmux, the ^M key is displayed in the terminal, but when I'm not in tmux, the code runs as expected.

1 Answer 1

1

The line discipline of the pseudo-terminal within tmux has its special characters and input flags set differently to the line discipline of whatever terminal you are attaching to tmux.

Run the command

stty -a

on both terminals, and note the difference(s). Adjust with the stty command according to taste. A "sane" starting point is often

stty sane

Of course, the manual for stty is your friend. ☺

1
  • My output in tmux and in normal terminal is the same when I do "stty -a" though the problem still persists. Any ideas? Thank you very much for the help, though! EDIT: stty sane worked, but it keeps un-doing itself. I'll have to look and see if I messed up my .bashrc or some other config. THANK YOU! Feb 11, 2014 at 22:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .