Merge pull request #104 from y574444354/fix/centos-input

fix(ink): treat newline as return and suppress favorite fetch error in TUI
This commit is contained in:
linkai0924 2026-05-15 11:16:39 +08:00 committed by GitHub
commit b90c8fc828
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 3 deletions

View File

@ -697,11 +697,12 @@ function parseKeypress(s: string = ''): ParsedKey {
return createNavKey(s, 'mouse', false)
}
if (s === '\r') {
if (s === '\r' || s === '\r\n') {
key.raw = undefined
key.name = 'return'
} else if (s === '\n') {
key.name = 'enter'
key.raw = undefined
key.name = 'return'
} else if (s === '\t') {
key.name = 'tab'
} else if (s === '\b' || s === '\x1b\b') {

View File

@ -6,6 +6,7 @@ import { getClaudeConfigHomeDir } from '../../utils/envUtils.js'
import { saveGlobalConfig, getGlobalConfig } from '../../utils/config.js'
import { clearSkillCaches } from '../../skills/loadSkillsDir.js'
import { parseFrontmatter } from '../../utils/frontmatterParser.js'
import { logForDebugging } from '../../utils/debug.js'
import type { McpServerConfig } from '../../services/mcp/types.js'
const FAVORITE_PAGE_SIZE = 20
@ -611,7 +612,7 @@ export async function listFavoriteItems(type?: FavoriteItemType): Promise<Favori
const page = await listRemoteCandidates(st, { favorited: 'true' })
candidates.push(...page)
} catch (error) {
console.warn('failed to fetch remote favorite candidates', { type: st, error })
logForDebugging(`failed to fetch remote favorite candidates: type=${st}, error=${error instanceof Error ? error.message : String(error)}`)
if (error instanceof Error) errors.push(error)
}
}