Skip to content

Commit 06b1dc6

Browse files
committed
refactor(cli): remove unused renderAnsiBlockImage functions
1 parent ed952e3 commit 06b1dc6

File tree

1 file changed

+0
-66
lines changed

1 file changed

+0
-66
lines changed

cli/src/utils/terminal-images.ts

Lines changed: 0 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
/**
22
* Terminal image rendering utilities
33
* Supports iTerm2 inline images protocol and Kitty graphics protocol
4-
* Falls back to ANSI block characters for unsupported terminals
54
*/
65

7-
import terminalImage from 'terminal-image'
8-
96
import { logger } from './logger'
107

118
export type TerminalImageProtocol = 'iterm2' | 'kitty' | 'sixel' | 'none'
@@ -226,66 +223,3 @@ export function getImageSupportDescription(): string {
226223
return 'No inline image support'
227224
}
228225
}
229-
230-
/**
231-
* Render an image using ANSI block characters (Unicode half-blocks)
232-
* This works in any terminal that supports 24-bit color
233-
* @param imageBuffer - Buffer containing image data
234-
* @param options - Display options
235-
* @returns Promise resolving to the ANSI escape sequence string
236-
*/
237-
export async function renderAnsiBlockImage(
238-
imageBuffer: Buffer,
239-
options: {
240-
width?: number
241-
height?: number
242-
} = {},
243-
): Promise<string> {
244-
const { width = 20, height = 10 } = options
245-
246-
try {
247-
const result = await terminalImage.buffer(imageBuffer, {
248-
width,
249-
height,
250-
preserveAspectRatio: true,
251-
})
252-
return result
253-
} catch (error) {
254-
logger.debug(
255-
{ error: error instanceof Error ? error.message : String(error) },
256-
'Failed to render ANSI block image from buffer',
257-
)
258-
return ''
259-
}
260-
}
261-
262-
/**
263-
* Render an image from a file path using ANSI block characters
264-
* @param filePath - Path to the image file
265-
* @param options - Display options
266-
* @returns Promise resolving to the ANSI escape sequence string
267-
*/
268-
export async function renderAnsiBlockImageFromFile(
269-
filePath: string,
270-
options: {
271-
width?: number
272-
height?: number
273-
} = {},
274-
): Promise<string> {
275-
const { width = 20, height = 10 } = options
276-
277-
try {
278-
const result = await terminalImage.file(filePath, {
279-
width,
280-
height,
281-
preserveAspectRatio: true,
282-
})
283-
return result
284-
} catch (error) {
285-
logger.debug(
286-
{ filePath, error: error instanceof Error ? error.message : String(error) },
287-
'Failed to render ANSI block image from file',
288-
)
289-
return ''
290-
}
291-
}

0 commit comments

Comments
 (0)