Skip to content

Commit

Permalink
make image() throw
Browse files Browse the repository at this point in the history
  • Loading branch information
t-bltg committed Dec 20, 2021
1 parent b928463 commit 071201b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion src/UnicodePlots.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion src/canvas/imgcanvas.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 071201b

Please sign in to comment.