From 071201b3d2f89efca016e5addce3394c6ebbde9a Mon Sep 17 00:00:00 2001 From: t-bltg Date: Mon, 20 Dec 2021 14:03:51 +0100 Subject: [PATCH] make image() throw --- .github/workflows/ci.yml | 2 +- src/UnicodePlots.jl | 2 +- src/canvas/imgcanvas.jl | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ae689dff..fbd7f8f4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,7 +15,7 @@ jobs: fail-fast: false matrix: version: - - '1.6' # LTS + - '1.0' # oldest supported in Project.toml - '1' # latest stable - 'nightly' os: diff --git a/src/UnicodePlots.jl b/src/UnicodePlots.jl index 623390cb..79f74f57 100644 --- a/src/UnicodePlots.jl +++ b/src/UnicodePlots.jl @@ -84,7 +84,7 @@ include("interface/heatmap.jl") include("interface/spy.jl") include("interface/boxplot.jl") -image(args...; kwargs...) = @warn "not implemented, did you forget 'using ImageInTerminal' ?" +image(args...; kwargs...) = error("not implemented, did you forget 'using ImageInTerminal' ?") function __init__() @require ImageInTerminal = "d8c32880-2388-543b-8c61-d9f865259254" begin diff --git a/src/canvas/imgcanvas.jl b/src/canvas/imgcanvas.jl index 671510a5..4cfd5c27 100644 --- a/src/canvas/imgcanvas.jl +++ b/src/canvas/imgcanvas.jl @@ -15,7 +15,9 @@ function render(c::ImgCanvas) if (c.sixel[] = ImageInTerminal.use_sixel(c.img)) h, w = size(c.img) # determine the terminal carret size, in pixels - char_pixels = ImageInTerminal.Sixel.TerminalTools.query_terminal("\e[16t", r"\e\[6;(\d+);(\d+)t", stdout) + char_pixels = ImageInTerminal.Sixel.TerminalTools.query_terminal( + "\e[16t", r"\e\[6;(\d+);(\d+)t", stdout + ) char_h, char_w = length(char_pixels) > 1 ? parse.(Int, char_pixels) : (15, 7) lines = String[] io = IOBuffer()