mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-06-09 08:21:50 +00:00
wrap preformatted ansi in <Ansi> component
This commit is contained in:
parent
690d62a6d1
commit
3bf0f39337
2 changed files with 3 additions and 2 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import { Box, Text } from '@hermes/ink'
|
||||
import { Ansi, Box, Text } from '@hermes/ink'
|
||||
import { memo } from 'react'
|
||||
|
||||
import { LONG_MSG, ROLE } from '../constants.js'
|
||||
|
|
@ -40,7 +40,7 @@ export const MessageLine = memo(function MessageLine({
|
|||
}
|
||||
|
||||
if (msg.role !== 'user' && hasAnsi(msg.text)) {
|
||||
return <Text wrap="wrap">{msg.text}</Text>
|
||||
return <Ansi>{msg.text}</Ansi>
|
||||
}
|
||||
|
||||
if (msg.role === 'assistant') {
|
||||
|
|
|
|||
1
ui-tui/src/types/hermes-ink.d.ts
vendored
1
ui-tui/src/types/hermes-ink.d.ts
vendored
|
|
@ -45,6 +45,7 @@ declare module '@hermes/ink' {
|
|||
}
|
||||
|
||||
export const Box: React.ComponentType<any>
|
||||
export const Ansi: React.ComponentType<any>
|
||||
export const Text: React.ComponentType<any>
|
||||
export const TextInput: React.ComponentType<any>
|
||||
export const stringWidth: (s: string) => number
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue