itermplot icon indicating copy to clipboard operation
itermplot copied to clipboard

Does not work under other terminal emulators

Open ikhomutov opened this issue 9 years ago • 19 comments

It seems to support only python 3.5 as I have this error with python 3.4:

Python 3.4.2 (default, Oct 8 2014, 10:45:20) [GCC 4.9.1] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import matplotlib.pyplot as plt >>> plt.plot([1,2,3]) [<matplotlib.lines.Line2D object at 0x7f3e03775da0>] >>> plt.show() Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python3.4/dist-packages/matplotlib/pyplot.py", line 252, in show return _show(args, **kw) File "/usr/local/lib/python3.4/dist-packages/itermplot/init.py", line 103, in show figmanager.show() File "/usr/local/lib/python3.4/dist-packages/itermplot/init.py", line 216, in show imgcat(data.getbuffer()) File "/usr/local/lib/python3.4/dist-packages/itermplot/init.py", line 76, in imgcat buf += linesb'\n' + csi + b'?25l' + csi + b'%dF' % lines + osc TypeError: unsupported operand type(s) for %: 'bytes' and 'int'

Will it work in future?

ikhomutov avatar Jan 16 '17 01:01 ikhomutov

Could you update itermplot and try now? pip3 install -U itermplot

daleroberts avatar Jan 16 '17 02:01 daleroberts

Ok, now it doesn't raise error, but output very large strange thing: ]1337;File=;size=5205;inline=1;width=auto;height=10;preserveAspectRatio=1:JVBERi0xLjQKJazcIKu6CjEgMCBvYmoKPDwgL1R5cGUgL0NhdGFsb2cgL1BhZ2VzIDIgMCBSID4+CmVuZG9iago4IDAgb2JqCjw8IC9Qcm9jU2V0IFsgL1BERiAvVGV4dCAvSW1hZ2VCIC9JbWFnZUMgL0ltYWdlSSBdIC9YT2JqZWN0IDcgMCBSCi9TaGFkaW5nIDYgMCBSIC9FeHRHU3RhdGUgNCAwIFIgL0ZvbnQgMyAwIFIgL1BhdHRlcm4gNSAwIFIgPj4KZW5kb2JqCjEwIDAgb2JqCjw8IC9Bbm5vdHMgWyBdIC9SZXNvdXJjZXMgOCAwIFIgL1R5cGUgL1BhZ2UKL0dyb3VwIDw8IC9UeXBlIC9Hcm91cCAvUyAvVHJhbnNwYXJlbmN5IC9DUyAvRGV2aWNlUkdCID4+IC9QYXJlbnQgMiAwIFIKL01lZGlhQm94IFsgMCAwIDU3NiA0MzIgXSAvQ29udGVudHMgOSAwIFIgPj4KZW5kb2JqCjkgMCBvYmoKPDwgL0ZpbHRlciAvRmxhdGVEZWNvZGUgL0xlbmd0aCAxMSAwIFIgPj4Kc3RyZWFtCnicjZTLTsMwEEX3/opZwsaxx484y0ZAJXYtkfiAUgpVW6lUgt9nYseJQxKZRWRfP+bcsSeWcGTFSsLhBgKO9P3Qt4biYf/9udtv1zXsbkzQ2JmZ0lJ78q1WSD3RtR+MXViJpDi2C6XjOohTJ5Rz3JGiRbHrN10hbtPatuu04Ra+9vAKFyhW2PpCeAZJ3qT3JqjdrhMaVoZalHYCYy9sA9dxGJ/eYOM83TJETsyOxkf50UyiZ+J1eEF4AQefieDGGzmMYboMEevUn+/qEKyOwSgPVjdQPEmQCM07s8i1URINKMFFaaB5Y3fUu4fmCI9Nb6IFM+kUt5HbiR4ddKRHlTUgS83FjAMz6yDc2egCBwdBRwdRZR2go9KZOJALZ6CFpYCdg070DoKODqLKOlAVRZhxMH8GM1UzOEiraKiprAMjaMPEAS6cQVJ8ti/n+q8xndT6Mlk7XgnbcivuXObwCSyxosLy5NBN0HEusJPpLFyi5egyB1+G18Kzw7PRk8N44PZTWSpK5NblD1sJ+ksDN3TTq+7mAjuZztOriouBvphz/6DY4XWaFppOH6//XDf9dTrS1ZD7hv0CNYFHBAplbmRzdHJlYW0KZW5kb2JqCjExIDAgb2JqCjQ0NAplbmRvYmoKMTYgMCBvYmoKPDwgL0ZpbHRlciAvR....

ikhomutov avatar Jan 16 '17 03:01 ikhomutov

UPD: Probably there is a problem with my environment, as it shows nothing in output window if I clear MPLBACKEND variable.

ikhomutov avatar Jan 16 '17 03:01 ikhomutov

Ok, I'm trying hard to replicate the problem by installing Python 3.4 but can't seem to get the latest matplotlib working with Py3.4...

Are you running under TMUX or something similar?

daleroberts avatar Jan 16 '17 04:01 daleroberts

Yes, tmux 2.3. But if I try to use it in pure terminal, without itermplot, the problem stays on. Also it represent this issues: https://github.com/matplotlib/matplotlib/issues/2976. So, problem could be in matplotlib. I will try to fix it, and inform you later.

ikhomutov avatar Jan 16 '17 04:01 ikhomutov

Ok, I fix this problem (just install cairocffi) so it shows me correct plot. But itermplot still shows me bunch of symbols.

ikhomutov avatar Jan 16 '17 04:01 ikhomutov

Even when you are not running under TMUX?

On Mon, Jan 16, 2017 at 3:24 PM, Ivan Khomutov [email protected] wrote:

Ok, I fix this problem (just install cairocffi) so it shows me correct plot. But itermplot still shows me bunch of symbols.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/daleroberts/itermplot/issues/10#issuecomment-272771132, or mute the thread https://github.com/notifications/unsubscribe-auth/AAjjJAAvWfomtAySq3cg4wHud1hjBkUjks5rSvDogaJpZM4LkGfF .

daleroberts avatar Jan 16 '17 04:01 daleroberts

Yes. Attached a screenshot for your convenience. screenshot from 2017-01-16 14 36 08

ikhomutov avatar Jan 16 '17 04:01 ikhomutov

To test, could you run it outside of TMUX?

On Mon, Jan 16, 2017 at 3:38 PM, Ivan Khomutov [email protected] wrote:

Yes. Attached a screenshot for your convenience. [image: screenshot from 2017-01-16 14 36 08] https://cloud.githubusercontent.com/assets/17610400/21971117/32c9861a-dbf9-11e6-934a-d9aa1400e9fb.png

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/daleroberts/itermplot/issues/10#issuecomment-272772478, or mute the thread https://github.com/notifications/unsubscribe-auth/AAjjJKetc9QW743MrtsY3jFcB7phZl9Rks5rSvQ2gaJpZM4LkGfF .

daleroberts avatar Jan 16 '17 04:01 daleroberts

Same result. screenshot from 2017-01-16 14 43 35

ikhomutov avatar Jan 16 '17 04:01 ikhomutov

The problem persists with ipython3 (instead of python3).

ikhomutov avatar Jan 16 '17 04:01 ikhomutov

Ok, I think I see the problem now. Is your terminal iTerm2 running on a Mac? https://www.iterm2.com/

It looks like you are on Linux? Normal terminals don't support inline images...

On Mon, Jan 16, 2017 at 3:44 PM, Ivan Khomutov [email protected] wrote:

Same result. [image: screenshot from 2017-01-16 14 43 35] https://cloud.githubusercontent.com/assets/17610400/21971205/32ccc2ac-dbfa-11e6-866f-c09b7ad217fe.png

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/daleroberts/itermplot/issues/10#issuecomment-272772991, or mute the thread https://github.com/notifications/unsubscribe-auth/AAjjJPytcDK96kEwRD08gjKKzpAhZ52Cks5rSvW0gaJpZM4LkGfF .

daleroberts avatar Jan 16 '17 04:01 daleroberts

Yes, I'm using debian 8.7. Are there any alternative terminals that will support your module on that os?

ikhomutov avatar Jan 16 '17 04:01 ikhomutov

Not for the moment, but I am looking into it... See some comments here:

https://www.reddit.com/r/Python/comments/5nojs2/an_awesome_iterm2_backend_for_matplotlib_so_you/dce93ig/

On Mon, Jan 16, 2017 at 3:54 PM, Ivan Khomutov [email protected] wrote:

Yes, I'm using debian 8.7. Are there any alternatives that will support your module on that os?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/daleroberts/itermplot/issues/10#issuecomment-272773868, or mute the thread https://github.com/notifications/unsubscribe-auth/AAjjJF4PvU_PdPSKuw4w1mF4gWOQbG4-ks5rSvgggaJpZM4LkGfF .

daleroberts avatar Jan 16 '17 04:01 daleroberts

Ok, thanks a lot.

ikhomutov avatar Jan 16 '17 04:01 ikhomutov

this might be a choice: https://github.com/saitoha/PySixel

garywu avatar Jan 19 '17 19:01 garywu

Have you had a look at hyper? Not sure how active the development is still around it, but it supports image display I believe.

chrisidefix avatar Feb 21 '17 22:02 chrisidefix

PS: https://github.com/zeit/hyper

chrisidefix avatar Feb 21 '17 22:02 chrisidefix

Hyper wont support the same protocol. Iterm2 sends these special leet 1337 escape sequences that only it understands. Searching hyper for 1337 shows no results.

JonathanAnderson avatar Feb 22 '17 03:02 JonathanAnderson