class Iterm2
- Iterm2
- Reference
- Object
Overview
Display images within the terminal using the ITerm2 Inline Images Protocol.
Defined in:
iterm2.crConstant Summary
-
VERSION =
{{ (`shards version \"/srv/crystaldoc.info/github-toddsundsted-iterm2-v0.1.0/src\"`).chomp.stringify }}
Constructors
-
.new(output : IO = STDOUT)
Creates a new instance.
Instance Method Summary
-
#display(input : IO, name = nil, size = nil, width = nil, height = nil, preserve_aspect_ratio : Bool = true, inline : Bool = true)
Wraps the input in the protocol envelop and writes the result to the output.
Constructor Detail
Instance Method Detail
Wraps the input in the protocol envelop and writes the result to the output.
By default, ITerm2 will display supported image formats within the terminal. It will download unsupported image formats and non-image inputs.
If downloading, name is the filename of the downloaded file (it
defaults to "Unnamed file") and "size" is the file size in bytes
(it is optional and only used by the ITerm2 progress indicator).
width and height are the width and height with which to
display the image. width and height are specified by a number
followed by an optional unit, or the word "auto". Units are pixels
("px") or the percent ("%") of the session's width or height. A
number without a unit specifies character cells.
If preserve_aspect_ratio is false, then the image's inherent
aspect ratio will not be respected; otherwise, it will fill the
specified width and height as much as possible without stretching.
It defaults to true.
If inline is false, the input will be downloaded with no visual
representation in the terminal session. Otherwise, it will be
displayed inline. It defaults to true.