keno / terminalextensions.jl Goto Github PK
View Code? Open in Web Editor NEWA package that makes Julia take advantage of cool terminal emulator features.
License: Other
A package that makes Julia take advantage of cool terminal emulator features.
License: Other
It would be very nice to have. Maybe it could be accomplished using
https://github.com/riscy/shx-for-emacs
What do you think?
I wanted to give this tool a try now that iTerm2 terminal extensions are in the wild. I pulled and built julia this morning and on the latest commit. I also checked-out Compat
and TerminalExtensions
to make sure I was on their latest commit as well. Compat is at 546eccb and TerminalExtensions is at 1402947. ITerm2 is Build 3.0.2.
I don't know how to give more debug assistance or how to further assist this issue since using TerminalExtensions
causes my terminal to become unresponsive.
I'm trying to get this to work for me in v1 since I used to love using this tool. I havent been able to get it to work, so i've put together what I think a MWE is and I'm running into a missing show method for a Base64EncodePipe
. I
I've put this tiny png image into an buffer and try to display it directly as follows
~/root/usr/install/julia/julia 2>stderr.log
_
_ _ _(_)_ | Documentation: https://docs.julialang.org
(_) | (_) (_) |
_ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 1.0.0 (2018-08-08)
_/ |\__'_|_|_|\__'_| |
|__/ |
julia> using TerminalExtensions
julia> x = UInt8[0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00,
0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x20, 0x00,
0x00, 0x00, 0x20, 0x01, 0x00, 0x00, 0x00, 0x00, 0x5b, 0x01, 0x47,
0x59, 0x00, 0x00, 0x00, 0x04, 0x67, 0x41, 0x4d, 0x41, 0x00, 0x01,
0x86, 0xa0, 0x31, 0xe8, 0x96, 0x5f, 0x00, 0x00, 0x00, 0x5b, 0x49,
0x44, 0x41, 0x54, 0x78, 0x9c, 0x2d, 0xcc, 0xb1, 0x09, 0x03, 0x30,
0x0c, 0x05, 0xd1, 0xeb, 0xd2, 0x04, 0xb2, 0x4a, 0x20, 0x0b, 0x7a,
0x34, 0x6f, 0x90, 0x15, 0x3c, 0x82, 0xc1, 0x8d, 0x0a, 0x61, 0x45,
0x07, 0x51, 0xf1, 0xe0, 0x8a, 0x2f, 0xaa, 0xea, 0xd2, 0xa4, 0x84,
0x6c, 0xce, 0xa9, 0x25, 0x53, 0x06, 0xe7, 0x53, 0x34, 0x57, 0x12,
0xe2, 0x11, 0xb2, 0x21, 0xbf, 0x4b, 0x26, 0x3d, 0x1b, 0x42, 0x73,
0x25, 0x25, 0x5e, 0x8b, 0xda, 0xb2, 0x9e, 0x6f, 0x6a, 0xca, 0x30,
0x69, 0x2e, 0x9d, 0x29, 0x61, 0x6e, 0xe9, 0x6f, 0x30, 0x65, 0xf0,
0xbf, 0x1f, 0x10, 0x87, 0x49, 0x2f, 0xd0, 0x2f, 0x14, 0xc9, 0x00,
0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82];
julia> display(TerminalExtensions.iTerm2.InlineDisplay(), MIME("image/png"), x)
ERROR: MethodError: no method matching show(::Base64.Base64EncodePipe, ::MIME{Symbol("image/png")}, ::Array{UInt8,1})
Closest candidates are:
show(::IO, ::MIME{Symbol("text/plain")}, ::AbstractArray) at arrayshow.jl:316
show(::IO, ::MIME{Symbol("text/plain")}, ::Any) at sysimg.jl:194
show(::IO, ::MIME{Symbol("text/csv")}, ::Any) at /home/janders/root/usr/install/julia/usr/share/julia/stdlib/v1.0/DelimitedFiles/src/DelimitedFiles.jl:828
...
Stacktrace:
[1] display(::TerminalExtensions.iTerm2.InlineDisplay, ::MIME{Symbol("image/png")}, ::Array{UInt8,1}) at /home/janders/.julia/packages/TerminalExtensions/Uyyx3/src/TerminalExtensions.jl:98
[2] top-level scope at none:0
so I define Base.show
and added an IO
field to the InlineDisplay so I could send output to stderr and pipe that to hd to see what was going on and this is what I got.
julia> Base.show(io::IO, ::MIME"image/png", x) = show(io, x)
julia> display(TerminalExtensions.iTerm2.InlineDisplay(stderr), MIME("image/png"), x)
1
julia> flush(stderr)
hd stderr.log
hd stderr
000000 1b 5d 31 33 33 37 3b 46 69 6c 65 3d 6e 61 6d 65 >.]1337;File=name<
000010 3d 61 57 31 68 5a 32 55 3d 3b 69 6e 6c 69 6e 65 >=aW1hZ2U=;inline<
000020 3d 31 3a 56 55 6c 75 64 44 68 62 4d 48 67 34 4f >=1:VUludDhbMHg4O<
000030 53 77 67 4d 48 67 31 4d 43 77 67 4d 48 67 30 5a >SwgMHg1MCwgMHg0Z<
000040 53 77 67 4d 48 67 30 4e 79 77 67 4d 48 67 77 5a >SwgMHg0NywgMHgwZ<
000050 43 77 67 4d 48 67 77 59 53 77 67 4d 48 67 78 59 >CwgMHgwYSwgMHgxY<
000060 53 77 67 4d 48 67 77 59 53 77 67 4d 48 67 77 4d >SwgMHgwYSwgMHgwM<
000070 43 77 67 4d 48 67 77 4d 43 77 67 4d 48 67 77 4d >CwgMHgwMCwgMHgwM<
000080 43 77 67 4d 48 67 77 5a 43 77 67 4d 48 67 30 4f >CwgMHgwZCwgMHg0O<
000090 53 77 67 4d 48 67 30 4f 43 77 67 4d 48 67 30 4e >SwgMHg0OCwgMHg0N<
0000a0 43 77 67 4d 48 67 31 4d 69 77 67 4d 48 67 77 4d >CwgMHg1MiwgMHgwM<
0000b0 43 77 67 4d 48 67 77 4d 43 77 67 4d 48 67 77 4d >CwgMHgwMCwgMHgwM<
0000c0 43 77 67 4d 48 67 79 4d 43 77 67 4d 48 67 77 4d >CwgMHgyMCwgMHgwM<
0000d0 43 77 67 4d 48 67 77 4d 43 77 67 4d 48 67 77 4d >CwgMHgwMCwgMHgwM<
0000e0 43 77 67 4d 48 67 79 4d 43 77 67 4d 48 67 77 4d >CwgMHgyMCwgMHgwM<
0000f0 53 77 67 4d 48 67 77 4d 43 77 67 4d 48 67 77 4d >SwgMHgwMCwgMHgwM<
000100 43 77 67 4d 48 67 77 4d 43 77 67 4d 48 67 77 4d >CwgMHgwMCwgMHgwM<
000110 43 77 67 4d 48 67 31 59 69 77 67 4d 48 67 77 4d >CwgMHg1YiwgMHgwM<
000120 53 77 67 4d 48 67 30 4e 79 77 67 4d 48 67 31 4f >SwgMHg0NywgMHg1O<
000130 53 77 67 4d 48 67 77 4d 43 77 67 4d 48 67 77 4d >SwgMHgwMCwgMHgwM<
000140 43 77 67 4d 48 67 77 4d 43 77 67 4d 48 67 77 4e >CwgMHgwMCwgMHgwN<
000150 43 77 67 4d 48 67 32 4e 79 77 67 4d 48 67 30 4d >CwgMHg2NywgMHg0M<
000160 53 77 67 4d 48 67 30 5a 43 77 67 4d 48 67 30 4d >SwgMHg0ZCwgMHg0M<
000170 53 77 67 4d 48 67 77 4d 43 77 67 4d 48 67 77 4d >SwgMHgwMCwgMHgwM<
000180 53 77 67 4d 48 67 34 4e 69 77 67 4d 48 68 68 4d >SwgMHg4NiwgMHhhM<
000190 43 77 67 4d 48 67 7a 4d 53 77 67 4d 48 68 6c 4f >CwgMHgzMSwgMHhlO<
0001a0 43 77 67 4d 48 67 35 4e 69 77 67 4d 48 67 31 5a >CwgMHg5NiwgMHg1Z<
0001b0 69 77 67 4d 48 67 77 4d 43 77 67 4d 48 67 77 4d >iwgMHgwMCwgMHgwM<
0001c0 43 77 67 4d 48 67 77 4d 43 77 67 4d 48 67 31 59 >CwgMHgwMCwgMHg1Y<
0001d0 69 77 67 4d 48 67 30 4f 53 77 67 4d 48 67 30 4e >iwgMHg0OSwgMHg0N<
0001e0 43 77 67 4d 48 67 30 4d 53 77 67 4d 48 67 31 4e >CwgMHg0MSwgMHg1N<
0001f0 43 77 67 4d 48 67 33 4f 43 77 67 4d 48 67 35 59 >CwgMHg3OCwgMHg5Y<
000200 79 77 67 4d 48 67 79 5a 43 77 67 4d 48 68 6a 59 >ywgMHgyZCwgMHhjY<
000210 79 77 67 4d 48 68 69 4d 53 77 67 4d 48 67 77 4f >ywgMHhiMSwgMHgwO<
000220 53 77 67 4d 48 67 77 4d 79 77 67 4d 48 67 7a 4d >SwgMHgwMywgMHgzM<
000230 43 77 67 4d 48 67 77 59 79 77 67 4d 48 67 77 4e >CwgMHgwYywgMHgwN<
000240 53 77 67 4d 48 68 6b 4d 53 77 67 4d 48 68 6c 59 >SwgMHhkMSwgMHhlY<
000250 69 77 67 4d 48 68 6b 4d 69 77 67 4d 48 67 77 4e >iwgMHhkMiwgMHgwN<
000260 43 77 67 4d 48 68 69 4d 69 77 67 4d 48 67 30 59 >CwgMHhiMiwgMHg0Y<
000270 53 77 67 4d 48 67 79 4d 43 77 67 4d 48 67 77 59 >SwgMHgyMCwgMHgwY<
000280 69 77 67 4d 48 67 33 59 53 77 67 4d 48 67 7a 4e >iwgMHg3YSwgMHgzN<
000290 43 77 67 4d 48 67 32 5a 69 77 67 4d 48 67 35 4d >CwgMHg2ZiwgMHg5M<
0002a0 43 77 67 4d 48 67 78 4e 53 77 67 4d 48 67 7a 59 >CwgMHgxNSwgMHgzY<
0002b0 79 77 67 4d 48 67 34 4d 69 77 67 4d 48 68 6a 4d >ywgMHg4MiwgMHhjM<
0002c0 53 77 67 4d 48 67 34 5a 43 77 67 4d 48 67 77 59 >SwgMHg4ZCwgMHgwY<
0002d0 53 77 67 4d 48 67 32 4d 53 77 67 4d 48 67 30 4e >SwgMHg2MSwgMHg0N<
0002e0 53 77 67 4d 48 67 77 4e 79 77 67 4d 48 67 31 4d >SwgMHgwNywgMHg1M<
0002f0 53 77 67 4d 48 68 6d 4d 53 77 67 4d 48 68 6c 4d >SwgMHhmMSwgMHhlM<
000300 43 77 67 4d 48 67 34 59 53 77 67 4d 48 67 79 5a >CwgMHg4YSwgMHgyZ<
000310 69 77 67 4d 48 68 68 59 53 77 67 4d 48 68 6c 59 >iwgMHhhYSwgMHhlY<
000320 53 77 67 4d 48 68 6b 4d 69 77 67 4d 48 68 68 4e >SwgMHhkMiwgMHhhN<
000330 43 77 67 4d 48 67 34 4e 43 77 67 4d 48 67 32 59 >CwgMHg4NCwgMHg2Y<
000340 79 77 67 4d 48 68 6a 5a 53 77 67 4d 48 68 68 4f >ywgMHhjZSwgMHhhO<
000350 53 77 67 4d 48 67 79 4e 53 77 67 4d 48 67 31 4d >SwgMHgyNSwgMHg1M<
000360 79 77 67 4d 48 67 77 4e 69 77 67 4d 48 68 6c 4e >ywgMHgwNiwgMHhlN<
000370 79 77 67 4d 48 67 31 4d 79 77 67 4d 48 67 7a 4e >ywgMHg1MywgMHgzN<
000380 43 77 67 4d 48 67 31 4e 79 77 67 4d 48 67 78 4d >CwgMHg1NywgMHgxM<
000390 69 77 67 4d 48 68 6c 4d 69 77 67 4d 48 67 78 4d >iwgMHhlMiwgMHgxM<
0003a0 53 77 67 4d 48 68 69 4d 69 77 67 4d 48 67 79 4d >SwgMHhiMiwgMHgyM<
0003b0 53 77 67 4d 48 68 69 5a 69 77 67 4d 48 67 30 59 >SwgMHhiZiwgMHg0Y<
0003c0 69 77 67 4d 48 67 79 4e 69 77 67 4d 48 67 7a 5a >iwgMHgyNiwgMHgzZ<
0003d0 43 77 67 4d 48 67 78 59 69 77 67 4d 48 67 30 4d >CwgMHgxYiwgMHg0M<
0003e0 69 77 67 4d 48 67 33 4d 79 77 67 4d 48 67 79 4e >iwgMHg3MywgMHgyN<
0003f0 53 77 67 4d 48 67 79 4e 53 77 67 4d 48 67 31 5a >SwgMHgyNSwgMHg1Z<
000400 53 77 67 4d 48 67 34 59 69 77 67 4d 48 68 6b 59 >SwgMHg4YiwgMHhkY<
000410 53 77 67 4d 48 68 69 4d 69 77 67 4d 48 67 35 5a >SwgMHhiMiwgMHg5Z<
000420 53 77 67 4d 48 67 32 5a 69 77 67 4d 48 67 32 59 >SwgMHg2ZiwgMHg2Y<
000430 53 77 67 4d 48 68 6a 59 53 77 67 4d 48 67 7a 4d >SwgMHhjYSwgMHgzM<
000440 43 77 67 4d 48 67 32 4f 53 77 67 4d 48 67 79 5a >CwgMHg2OSwgMHgyZ<
000450 53 77 67 4d 48 67 35 5a 43 77 67 4d 48 67 79 4f >SwgMHg5ZCwgMHgyO<
000460 53 77 67 4d 48 67 32 4d 53 77 67 4d 48 67 32 5a >SwgMHg2MSwgMHg2Z<
000470 53 77 67 4d 48 68 6c 4f 53 77 67 4d 48 67 32 5a >SwgMHhlOSwgMHg2Z<
000480 69 77 67 4d 48 67 7a 4d 43 77 67 4d 48 67 32 4e >iwgMHgzMCwgMHg2N<
000490 53 77 67 4d 48 68 6d 4d 43 77 67 4d 48 68 69 5a >SwgMHhmMCwgMHhiZ<
0004a0 69 77 67 4d 48 67 78 5a 69 77 67 4d 48 67 78 4d >iwgMHgxZiwgMHgxM<
0004b0 43 77 67 4d 48 67 34 4e 79 77 67 4d 48 67 30 4f >CwgMHg4NywgMHg0O<
0004c0 53 77 67 4d 48 67 79 5a 69 77 67 4d 48 68 6b 4d >SwgMHgyZiwgMHhkM<
0004d0 43 77 67 4d 48 67 79 5a 69 77 67 4d 48 67 78 4e >CwgMHgyZiwgMHgxN<
0004e0 43 77 67 4d 48 68 6a 4f 53 77 67 4d 48 67 77 4d >CwgMHhjOSwgMHgwM<
0004f0 43 77 67 4d 48 67 77 4d 43 77 67 4d 48 67 77 4d >CwgMHgwMCwgMHgwM<
000500 43 77 67 4d 48 67 77 4d 43 77 67 4d 48 67 30 4f >CwgMHgwMCwgMHg0O<
000510 53 77 67 4d 48 67 30 4e 53 77 67 4d 48 67 30 5a >SwgMHg0NSwgMHg0Z<
000520 53 77 67 4d 48 67 30 4e 43 77 67 4d 48 68 68 5a >SwgMHg0NCwgMHhhZ<
000530 53 77 67 4d 48 67 30 4d 69 77 67 4d 48 67 32 4d >SwgMHg0MiwgMHg2M<
000540 43 77 67 4d 48 67 34 07 >CwgMHg4.<
000548
When I manually base64encoded the buffer, it didnt look like this either.
Is this user error or is something broken here?
If I start typing as Julia is starting up with TerminalExtensions in my .juliarc.jl, it fails to recognize that and fails to parse the response code (which is then spewed onto the prompt).
It seems like the test for bytes waiting on STDIN at TerminalExtensions.jl:44 isn't quite working. Perhaps it needs to yield first?
Ideally, TerminalExtensions would be able to grab the available bytes, do its request, and then put them back at the prompt. But there'd still be a race where the user could corrupt the response by typing within some window. I've not looked into this yet, but there's probably no way to do this on another IO stream, is there?
Sometimes, when interrupting the REPL output, I hit an assertion failure. It doesn't happen all the time, but with the following test case I can typically trigger it within 3-4 interruptions, on both the 0.3 release branch and today's master (10f9289).
julia> s = "a really long string"^10000
"a really long stringa really long stringa really long stringa really long strin
⋮
ga re^ClError showing value of type ASCIIString:
ERROR: interrupt
ERROR: assertion failed
in test_success at ./process.jl:483
in readbytes at ./process.jl:461
in prompt_prefix at /Users/mbauman/.julia/v0.4/TerminalExtensions/src/TerminalExtensions.jl:127
in anonymous at /Users/mbauman/.julia/v0.4/TerminalExtensions/src/TerminalExtensions.jl:214
in write_prompt at LineEdit.jl:644
in refresh_multi_line at LineEdit.jl:203
in activate at ./LineEdit.jl:1251
in activate at /Users/mbauman/Code/julia-0.4/usr/lib/julia/sys.dylib
in transition at ./LineEdit.jl:1273
in anonymous at REPL.jl:597
in anonymous at /Users/mbauman/.julia/v0.4/TerminalExtensions/src/TerminalExtensions.jl:225
in run_interface at ./LineEdit.jl:1329
in run_interface at /Users/mbauman/Code/julia-0.4/usr/lib/julia/sys.dylib
in run_frontend at ./REPL.jl:825
in run_repl at ./REPL.jl:170
in _start at ./client.jl:427
in _start at /Users/mbauman/Code/julia-0.4/usr/lib/julia/sys.dylib
I think this might actually be a Julia bug, but I've not managed to track it down yet.
Hi there, would love to use the figure cat in iTerm but this doesn't seem to work for me on Julia 0.4.2. Error is:
julia> using TerminalExtensions
...
ERROR (unhandled task failure): UndefVarError: start_reading not defined
[inlined code] from /Users/me/.julia/v0.4/TerminalExtensions/src/TerminalExtensions.jl:201
in anonymous at task.jl:447
Might this be related to JuliaLang/julia#1925 ?
There's also a bunch of warnings about WARNING: Base.Uint8 is deprecated, use UInt8 instead.
but I assume that's unrelated. (I'm very new to Julia so I'm not really sure how to address this.)
The output from Plots.jl cannot be rendered. Errors or broken images are produces.
The following code produces a bunch of text with julia 0.6.0, iTerm2 3.0.15, and the latest master of TerminalExtensions (f0d8a52).
import TerminalExtensions
import PyPlot
fig, ax = PyPlot.subplots()
ax[:plot]([1, 2, 3, 4, 5])
display(fig); println()
display(fig); println()
PyPlot.close(fig)
The first display(fig)
produces text like this (the text is truncated):
iVBORw0KGgoAAAANSUhEUgAAAicAAAGgCAYAAABxDccgAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAPYQAAD2EBqD+naQAAIABJREFUeJzs3Xl8FIX9//HX5g4hWc4kQAKCARKOXHgQPPBAERCJKGDi70tb0W8PLkWpQq1WsYYWUbmKWr8V2xoQUEERRcQCIlCFJJBw3wlHwpndHGST7M7vD7/ftFhANiSZzeb9fDzm8egOM5n3Wsy8nc/MrsUwDAMRERERD+FjdgARERGRf6dyIiIiIh5F5UREREQ8isqJiIiIeBSVExEREfEoKiciIiLiUVRORERExKOonIiIiIhHUTkRERERj6JyIiIiIh5F5UREREQ8ip/ZAa6Ey+Xi+PHjhIaGYrFYzI4jIiIiV8AwDEpKSmjfvj0+Pld+PaRRlJPjx48THR1tdgwRERGphYKCAqKioq54+0...
The second display(fig)
displays the figure. This describes the behavior if you open a julia REPL and run that code line by line. If you put it in a file and include("filename.jl")
, the behavior is a bit different. The first time you include
it, text is displayed twice and no figures are displayed. On subsequent include
s, the figure is displayed twice.
With TerminalExtensions, attempts to plot(1:10)
with the plotlyjs backend result in
Error showing value of type Plots.Plot{Plots.PlotlyJSBackend}:
ERROR: MethodError: no method matching handle_new_from_data(::String)
The applicable method may be too new: running in world age 21869, while current world is 21889.
Closest candidates are:
handle_new_from_data(::AbstractString) at /Users/bromberger1/.julia/v0.6/Rsvg/src/calls.jl:69 (method too new to be called from this world context.)
handle_new_from_data(::AbstractString, ::Gtk.GLib.GError) at /Users/bromberger1/.julia/v0.6/Rsvg/src/calls.jl:61 (method too new to be called from this world context.)
When TerminalExtensions is not loaded via ~/.juliarc.jl
, plots work.
I have had some problems with TerminalExtensions freezing my julia session so that I can't type anything and things like Ctrl-C have no effect. It seems to occur in a variety of situations. I am using TerminalExtensions 0.4.0, iTerm2 3.2.3 and have reproduced it with julia 0.7.0 and 1.0.1. Here is a simple example that reproduces it on my machine from the start of a fresh julia session:
using TerminalExtensions
and hit returna
a
I have also run into similar freezes when using tab completion, but haven't been able to come up with a reproducible example of this. Maybe the issues are related?
I've installed iTerm2 nightly and tested image display and command history works in the terminal. My .juliarc.jl:
using TerminalExtensions, PyPlot
PyPlot works, but I don't see any of the features of terminal enhancement - I'm not testing image display here, but even things like command completion, marking or history doesn't do anything.
I'm on OSX 10.9.3, iterm 1.0.0.20140525-nightly
Disclaimer: I've never used Julia before.
First I tried just putting "using TerminalExtensions" in my ~/.juliarc.jl, but I get this error:
ERROR: TerminalExtensions not found
in require at loading.jl:39
in include at boot.jl:238
in include_from_node1 at loading.jl:114
in try_include at client.jl:219
in load_juliarc at client.jl:356
in _start at client.jl:391
at /Users/georgen/.juliarc.jl:1
So I cloned your git repo and modified my juliarc to:
push!(LOAD_PATH, "/Users/georgen/git/TerminalExtensions.jl/src")
using TerminalExtensions
But then I got this error:
ERROR: Terminals not defined
in include at boot.jl:238
in include_from_node1 at loading.jl:114
in reload_path at loading.jl:140
in _require at loading.jl:58
in require at loading.jl:43
in include at boot.jl:238
in include_from_node1 at loading.jl:114
in try_include at client.jl:219
in load_juliarc at client.jl:356
in _start at client.jl:391
at /Users/georgen/git/TerminalExtensions.jl/src/TerminalExtensions.jl:8
at /Users/georgen/.juliarc.jl:2
I've installed Julia-0.3.0-prerelease-547facf2c1 for Mac OS, which is the most recent version I found (it's a nightly snapshot, so I'd think it would have everything?)
Since Base.Terminals seems to be part of the standard library, I'm not quite sure what to do next.
It looks like there's a function to send the shell integration version, but it is not called. iTerm2's bash shell integration script had a bug for a while where it did not send ShellIntegrationVersion and I'd like to be able to ask those users to upgrade. It's hard to tell bash from Julia if neither sends this code, though. I suggest:
function shell_version_number()
return "\033]1337;ShellIntegrationVersion=1;shell=julia\007"
end
I think you'd want to call the function after if startswith(itermname, "ITERM2")
, although I don't understand the Julia-specific parts well enough to be sure about that.
I use tmux with iterm2.
there seems to be problems using iterm2 Build 3.0.10.
the images are broken.
I love TerminalExtensions. It allows me to use LightGraphs and GraphPlot to visualize graph structures.
That said, I just installed a new version of iterm (Build 2.9.20151111) on a new mac and am no longer able to view the graphplots: this used to work:
using LightGraphs, GraphPlot
g = Graph(10,10)
gplot(g)
and would draw the graph inside the REPL. Now, I get Compose output:
julia> gplot(g)
Compose.Context(Measures.BoundingBox{Tuple{Measures.Length{:w,Float64},Measures.Length{:h,Float64}},Tuple{Measures.Length{:w,Float64},Measures.Length{:h,Float64}}}((0.0w,0.0h),(1.0w,1.0h)),Nullable(Compose.UnitBox{Float64,Float64,Float64,Float64}(-1.2,-1.2,2.4,2.4,0.0mm,0.0mm,0.0mm,0.0mm)),Nullable{Compose.Rotation{P<:NTuple{N,Measures.Measure}}}(),Nullable{Compose.Mirror}(),Compose.ListNode{Compose.Container}(Compose.Context(Measures.BoundingBox{Tuple{Measures.Length{:w,Float64},Measures.Length{:h,Float64}},Tuple{Measures.Length{:w,Float64},Measures.Length{:h,Float64}}}((0.0w,0.0h),(1.0w,1.0h)),Nullable{Compose.UnitBox{S,T,U,V}}(),Nullable{Compose.Rotation{P<:NTuple{N,Measures.Measure}}}(),Nullable{Compose.Mirror}(),Compose.ListNull{Compose.Container}(),Compose.ListNode{Compose.Form{P<:Compose.FormPrimitive}}(Compose.Form{Compose.LinePrimitive{P<:NTuple{N,Measures.Measure}}}(Compose.LinePrimitive[Compose.LinePrimitive{Tuple{Measures.Measure,Measures.Measure}}(Tuple{Measures.Measure,Measures.Measure}[(0.6529587029146515cx,0.3595813375029016cy),(0.7618886606153052cx,0.3518912499653421cy)]),Compose.LinePrimitive{Tuple{Measures.Measure,Measures.Measure}}(Tuple{Measures.Measure,Measures.Measure}[(0.8748903354650068cx,0.4330033841189778cy),(0.9384262087825634cx,0.38183837283848504cy)]),Compose.LinePrimitive{Tuple{Measures.Measure,Measures.Measure}}(Tuple{Measures.Measure,Measures.Measure}[(0.5692570785228801cx,0.4483251006164699cy),(0.5695046122326353cx,0.44407201835746357cy)]),Compose.LinePrimitive{Tuple{Measures.Measure,Measures.Measure}}(Tuple{Measures.Measure,Measures.Measure}[(0.8893261186330096cx,0.5043264349188082cy),(0.9049122649312996cx,0.5087839400399728cy)]),Compose.LinePrimitive{Tuple{Measures.Measure,Measures.Measure}}(Tuple{Measures.Measure,Measures.Measure}[(0.8289192626256028cx,0.4050863750129874cy),(0.8251466117850259cx,0.423825921605544cy)]),Compose.LinePrimitive{Tuple{Measures.Measure,Measures.Measure}}(Tuple{Measures.Measure,Measures.Measure}[(0.9330464202373743cx,0.4676098363249154cy),(0.8886247492424231cx,0.4092361474801082cy)]),Compose.LinePrimitive{Tuple{Measures.Measure,Measures.Measure}}(Tuple{Measures.Measure,Measures.Measure}[(0.9966966791960699cx,0.26248594922876606cy),(0.9962610335283588cx,0.25328493752744113cy)]),Compose.LinePrimitive{Tuple{Measures.Measure,Measures.Measure}}(Tuple{Measures.Measure,Measures.Measure}[(0.9389672695361578cx,0.24126720999886772cy),(0.8947397733513293cx,0.28857421641840797cy)]),Compose.LinePrimitive{Tuple{Measures.Measure,Measures.Measure}}(Tuple{Measures.Measure,Measures.Measure}[(0.9212498443176274cx,0.3392113567332113cy),(0.9194994858454311cx,0.339366009070494cy)]),Compose.LinePrimitive{Tuple{Measures.Measure,Measures.Measure}}(Tuple{Measures.Measure,Measures.Measure}[(0.7355047133320597cx,0.4965640002061885cy),(0.6424754883041277cx,0.5132728279180326cy)])],symbol("")),Compose.ListNull{Compose.Form{P<:Compose.FormPrimitive}}()),Compose.ListNode{Compose.Property{P<:Compose.PropertyPrimitive}}(Compose.Property{Compose.LineWidthPrimitive}([Compose.LineWidthPrimitive(0.9486832980505138mm)]),Compose.ListNode{Compose.Property{P<:Compose.PropertyPrimitive}}(Compose.Property{Compose.FillPrimitive}([Compose.FillPrimitive(RGBA{Float64}(0.0,0.0,0.0,0.0))]),Compose.ListNode{Compose.Property{P<:Compose.PropertyPrimitive}}(Compose.Property{Compose.StrokePrimitive}([Compose.StrokePrimitive(RGBA{Float64}(0.8274509803921568,0.8274509803921568,0.8274509803921568,1.0))]),Compose.ListNull{Compose.Property{P<:Compose.PropertyPrimitive}}()))),0,false,false,false,false,nothing,nothing,0.0,symbol("")),Compose.ListNode{Compose.Container}(Compose.Context(Measures.BoundingBox{Tuple{Measures.Length{:w,Float64},Measures.Length{:h,Float64}},Tuple{Measures.Length{:w,Float64},Measures.Length{:h,Float64}}}((0.0w,0.0h),(1.0w,1.0h)),Nullable{Compose.UnitBox{S,T,U,V}}(),Nullable{Compose.Rotation{P<:NTuple{N,Measures.Measure}}}(),Nullable{Compose.Mirror}(),Compose.ListNull{Compose.Container}(),Compose.ListNull{Compose.Form{P<:Compose.FormPrimitive}}(),Compose.ListNode{Compose.Property{P<:Compose.PropertyPrimitive}}(Compose.Property{Compose.LineWidthPrimitive}([Compose.LineWidthPrimitive(0.9486832980505138mm)]),Compose.ListNode{Compose.Property{P<:Compose.PropertyPrimitive}}(Compose.Property{Compose.StrokePrimitive}([Compose.StrokePrimitive(RGBA{Float64}(0.8274509803921568,0.8274509803921568,0.8274509803921568,1.0))]),Compose.ListNull{Compose.Property{P<:Compose.PropertyPrimitive}}())),0,false,false,false,false,nothing,nothing,0.0,symbol("")),Compose.ListNode{Compose.Container}(Compose.Context(Measures.BoundingBox{Tuple{Measures.Length{:w,Float64},Measures.Length{:h,Float64}},Tuple{Measures.Length{:w,Float64},Measures.Length{:h,Float64}}}((0.0w,0.0h),(1.0w,1.0h)),Nullable{Compose.UnitBox{S,T,U,V}}(),Nullable{Compose.Rotation{P<:NTuple{N,Measures.Measure}}}(),Nullable{Compose.Mirror}(),Compose.ListNull{Compose.Container}(),Compose.ListNull{Compose.Form{P<:Compose.FormPrimitive}}(),Compose.ListNode{Compose.Property{P<:Compose.PropertyPrimitive}}(Compose.Property{Compose.FontSizePrimitive}([Compose.FontSizePrimitive(4.0mm)]),Compose.ListNode{Compose.Property{P<:Compose.PropertyPrimitive}}(Compose.Property{Compose.StrokePrimitive}([Compose.StrokePrimitive(RGBA{Float64}(0.0,0.0,0.0,0.0))]),Compose.ListNode{Compose.Property{P<:Compose.PropertyPrimitive}}(Compose.Property{Compose.FillPrimitive}([Compose.FillPrimitive(RGBA{Float64}(0.0,0.0,0.0,1.0))]),Compose.ListNull{Compose.Property{P<:Compose.PropertyPrimitive}}()))),0,false,false,false,false,nothing,nothing,0.0,symbol("")),Compose.ListNode{Compose.Container}(Compose.Context(Measures.BoundingBox{Tuple{Measures.Length{:w,Float64},Measures.Length{:h,Float64}},Tuple{Measures.Length{:w,Float64},Measures.Length{:h,Float64}}}((0.0w,0.0h),(1.0w,1.0h)),Nullable{Compose.UnitBox{S,T,U,V}}(),Nullable{Compose.Rotation{P<:NTuple{N,Measures.Measure}}}(),Nullable{Compose.Mirror}(),Compose.ListNull{Compose.Container}(),Compose.ListNode{Compose.Form{P<:Compose.FormPrimitive}}(Compose.Form{Compose.CirclePrimitive{Tuple{Measures.Measure,Measures.Measure},Measures.Measure}}([Compose.CirclePrimitive{Tuple{Measures.Measure,Measures.Measure},Measures.Measure}((-1.0cx,-0.6915889337819887cy),0.0316227766016838w),Compose.CirclePrimitive{Tuple{Measures.Measure,Measures.Measure},Measures.Measure}((0.8133165442475703cx,0.48258834388614447cy),0.0316227766016838w),Compose.CirclePrimitive{Tuple{Measures.Measure,Measures.Measure},Measures.Measure}((0.9929577127244287cx,0.1835174736848888cy),0.0316227766016838w),Compose.CirclePrimitive{Tuple{Measures.Measure,Measures.Measure},Measures.Measure}((1.0cx,0.3322534130713184cy),0.0316227766016838w),Compose.CirclePrimitive{Tuple{Measures.Measure,Measures.Measure},Measures.Measure}((0.564663657388617cx,0.5272484842380767cy),0.0316227766016838w),Compose.CirclePrimitive{Tuple{Measures.Measure,Measures.Measure},Measures.Measure}((0.9809218393167389cx,0.5305220310726366cy),0.0316227766016838w),Compose.CirclePrimitive{Tuple{Measures.Measure,Measures.Measure},Measures.Measure}((-0.770419141566406cx,1.0cy),0.0316227766016838w),Compose.CirclePrimitive{Tuple{Measures.Measure,Measures.Measure},Measures.Measure}((0.5740980333668984cx,0.3651486347358568cy),0.0316227766016838w),Compose.CirclePrimitive{Tuple{Measures.Measure,Measures.Measure},Measures.Measure}((0.0009998978873759778cx,-1.0cy),0.0316227766016838w),Compose.CirclePrimitive{Tuple{Measures.Measure,Measures.Measure},Measures.Measure}((0.8407493301630584cx,0.3463239527323869cy),0.0316227766016838w)],symbol("")),Compose.ListNull{Compose.Form{P<:Compose.FormPrimitive}}()),Compose.ListNode{Compose.Property{P<:Compose.PropertyPrimitive}}(Compose.Property{Compose.LineWidthPrimitive}([Compose.LineWidthPrimitive(0.0mm)]),Compose.ListNode{Compose.Property{P<:Compose.PropertyPrimitive}}(Compose.Property{Compose.StrokePrimitive}([Compose.StrokePrimitive(RGBA{Float64}(0.0,0.0,0.0,0.0))]),Compose.ListNode{Compose.Property{P<:Compose.PropertyPrimitive}}(Compose.Property{Compose.FillPrimitive}([Compose.FillPrimitive(RGBA{Float64}(0.25098039215686274,0.8784313725490196,0.8156862745098039,1.0))]),Compose.ListNull{Compose.Property{P<:Compose.PropertyPrimitive}}()))),0,false,false,false,false,nothing,nothing,0.0,symbol("")),Compose.ListNode{Compose.Container}(Compose.Context(Measures.BoundingBox{Tuple{Measures.Length{:w,Float64},Measures.Length{:h,Float64}},Tuple{Measures.Length{:w,Float64},Measures.Length{:h,Float64}}}((0.0w,0.0h),(1.0w,1.0h)),Nullable{Compose.UnitBox{S,T,U,V}}(),Nullable{Compose.Rotation{P<:NTuple{N,Measures.Measure}}}(),Nullable{Compose.Mirror}(),Compose.ListNull{Compose.Container}(),Compose.ListNull{Compose.Form{P<:Compose.FormPrimitive}}(),Compose.ListNode{Compose.Property{P<:Compose.PropertyPrimitive}}(Compose.Property{Compose.FontSizePrimitive}([Compose.FontSizePrimitive(4.0mm)]),Compose.ListNode{Compose.Property{P<:Compose.PropertyPrimitive}}(Compose.Property{Compose.StrokePrimitive}([Compose.StrokePrimitive(RGBA{Float64}(0.0,0.0,0.0,0.0))]),Compose.ListNode{Compose.Property{P<:Compose.PropertyPrimitive}}(Compose.Property{Compose.FillPrimitive}([Compose.FillPrimitive(RGBA{Float64}(0.0,0.0,0.0,1.0))]),Compose.ListNull{Compose.Property{P<:Compose.PropertyPrimitive}}()))),0,false,false,false,false,nothing,nothing,0.0,symbol("")),Compose.ListNull{Compose.Container}()))))),Compose.ListNull{Compose.Form{P<:Compose.FormPrimitive}}(),Compose.ListNull{Compose.Property{P<:Compose.PropertyPrimitive}}(),0,false,false,false,false,nothing,nothing,0.0,symbol(""))
Did I forget to initialize something?
and hardly any documentation
if you use Julia 0.5 with tmux, TerminalExtensions.jl hangs forever.
if you use Julia 0.4 with tmux, TerminalExtensions.jl does not work as well but at least produces only an error message.
I just installed TerminalExtensions, and got the following error message. Prior to that, I simply installed the package and then added atreplinit((_)->require(:TerminalExtensions))
to my .juliarc.jl
as described, and restarted julia.
Christoph
$ julia
_
_ _ ()_ | A fresh approach to technical computing
() | () () | Documentation: http://docs.julialang.org
_ _ | | __ _ | Type "?help" for help.
| | | | | | |/ ` | |
| | || | | | (| | | Version 0.4.0-rc1 (2015-09-09 16:07 UTC)
/ |_'|||__'| | Official http://julialang.org/ release
|__/ | x86_64-apple-darwin13.4.0
ERROR (unhandled task failure): UndefVarError: start_reading not defined
[inlined code] from /Users/ortner/.julia/v0.4/TerminalExtensions/src/TerminalExtensions.jl:201
in anonymous at task.jl:448
Gadfly.plot(x=1:10)
output goes to the default app; does not show in the terminal
This hangs regardless if it's in .juliarc.jl
or when called in REPL with using TerminalExtensions
. Control-D crashes the terminal window.
Currently, the README says:
Simply put
atreplinit((_)->Base.require(:TerminalExtensions))
in your.juliarc.jl
and everything should be detected and configured automatically.
Should it instead say this?
Simply put
atreplinit((_)->Base.require(:TerminalExtensions))
in your~/.julia/config/startup.jl
and everything should be detected and configured automatically.
The section in TerminalExtensions.jl
that sends "\e[1337n\e[5n"
fails to detect iTerm support when running inside a tmux session.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.