Pasting a large chunk of code to tmux on Mac OSX

做~自己de王妃 提交于 2019-12-13 07:59:57

问题


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.

来源:https://stackoverflow.com/questions/29455383/pasting-a-large-chunk-of-code-to-tmux-on-mac-osx

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!