@@ -6,11 +6,13 @@ import type { TerminalLifecycleState } from "./terminal-panel-runtime-types.js"
66import type { ActiveTerminalSession } from "./terminal.js"
77
88export const terminalInlineImagePreviewLimit = 20
9- export const terminalInlineImagePreviewRows = 7
9+ export const terminalInlineImagePreviewRows = 4
1010
1111export const terminalInlineImageSpacer = "\r\n" . repeat ( terminalInlineImagePreviewRows )
1212
13- const terminalInlineImagePreviewColumns = 28
13+ const terminalInlineImagePreviewColumns = 16
14+ const terminalInlineImagePreviewHeightPx = 56
15+ const terminalInlineImagePreviewWidthPx = 96
1416
1517type TerminalInlineImageEntry = {
1618 readonly fetchUrl : string
@@ -56,21 +58,21 @@ const renderInlineImageElement = (
5658 link . style . boxSizing = "border-box"
5759 link . style . cursor = "pointer"
5860 link . style . display = "inline-flex"
59- link . style . height = " calc(100% - 8px)"
61+ link . style . height = `min( ${ terminalInlineImagePreviewHeightPx } px, calc(100% - 8px))`
6062 link . style . justifyContent = "center"
6163 link . style . margin = "4px 0"
6264 link . style . padding = "4px"
6365 link . style . pointerEvents = "auto"
64- link . style . width = " 100%"
66+ link . style . width = `min( ${ terminalInlineImagePreviewWidthPx } px, 100%)`
6567
6668 const image = document . createElement ( "img" )
6769 image . alt = entry . path
6870 image . src = entry . fetchUrl
6971 image . style . borderRadius = "4px"
7072 image . style . display = "block"
71- image . style . maxHeight = "100%"
72- image . style . maxWidth = "100%"
73+ image . style . height = "100%"
7374 image . style . objectFit = "contain"
75+ image . style . width = "100%"
7476
7577 link . append ( image )
7678 element . dataset [ "path" ] = entry . path
0 commit comments