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:
commit
b90c8fc828
|
|
@ -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') {
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user