imgcat
Generates an iTerm2-compatible escape sequence to display an image from a specified file path directly in the terminal.
def imgcat(
path: string,
inline: integer = 1,
preserve_aspect_ratio: integer = 0,
**kwargs: Any
) - > string
Generates an iTerm2-compatible escape sequence to display an image directly in the terminal.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string | The local file system path to the image file to be displayed. |
| inline | integer = 1 | Controls whether the image is displayed inline (1) or as an attachment (0). |
| preserve_aspect_ratio | integer = 0 | Determines if the image should maintain its original aspect ratio (1) or scale to fit (0). |
| **kwargs | Any | Additional keyword arguments for future extensibility or internal configuration. |
Returns
| Type | Description |
|---|---|
string | A formatted string containing the ANSI escape sequence and base64-encoded image data. |