0

Suppose I open a python on tmux. If I paste a large chunk of code which involves some delays and print statements, tmux will return some random rubbish to me.

For example, if I copy the following code (please manually to repeat the middle part)

import time
print("hello world");time.sleep(0.02)
print("hello world");time.sleep(0.02)
.
.  (please repeat it at least 50 times)
.
print("hello world");time.sleep(0.02)

and paste it to the tmux window. It doesn't return what we expected but some random mix of the original input.

>>> print("hello world");time.sleep(0.02print("hello world");time.sleep(0.0202print("hello world");time.sleep(0.0.02print("hello world");time.sleep(0.0.02print("hello world");time.sleep(0.0202print("hello world");time.sleep(0.0202print("hello world");time.sleep(0.0.02print("hello world");time.sleep(0.0202print("hello world");time.sleep(0.0202print("hello world");time.sleep(0.0202print("hello world");time.sleep(0.0202print("hello world");time.sleep(0.0202print("hello world");time.sleep(0.0.02print("hello world");time.sleep(0.0.02print("hello world");time.sleep(0.0202print("hello world");time.sleep(0.0202print("hello world");time.sleep(0.0202print("hello world");time.sleep(0.0202print("hello world");time.sleep(0.0202print("hello world");time.sleep(0.0.02print("hello world");time.sleep(0.0202print("hello world");time.sleep(0.0202print("hello world");time.sleep(0.0202print("hello world");time.sleep(0.0202print("hello world");time.sleep(0.0202print("hello world");time.sleep(0.0202print("hello world");time.sleep(0.0202

PS:

  1. It doesn't happen on my linux machine, but only my Mac

  2. It also doesn't happen when I open python without tmux.

So my question: is there anything I am missing? or is it a bug of tmux?

tmux 1.9a, python 2.x and 3.x, mac osx yosemite.

Randy Lai
  • 3,084
  • 2
  • 22
  • 23
  • What terminal emulator are you using? I can actually reproduce this without `tmux` in iTerm2. I don't know what the problem is, but it certainly seems independent of `tmux`. – chepner Apr 08 '15 at 20:50
  • I am using Terminal. I seems that iTerm is using something similar to `tmux` and it has the same bug. – Randy Lai Apr 09 '15 at 00:10
  • Interesting. `iTerm` doesn't actually *use* `tmux`; it can communicate with an instance to map things like `tmux` windows to `iTerm` panes, so I'm not sure how an input problem would be shared (but I don't really know how the integration is implemented). – chepner Apr 09 '15 at 14:10

0 Answers0