feat: 将 keybinding 纳入 ink 管辖

This commit is contained in:
claude-code-best
2026-04-07 17:51:01 +08:00
parent e5782e732c
commit f268b16b31
17 changed files with 1101 additions and 1090 deletions

View File

@@ -41,7 +41,7 @@ import { getRemoteSessionUrl } from './constants/product.js'
import { getSystemContext, getUserContext } from './context.js'
import { init, initializeTelemetryAfterTrust } from './entrypoints/init.js'
import { addToHistory } from './history.js'
import type { Root } from './ink.js'
import type { Root } from '@anthropic/ink'
import { launchRepl } from './replLauncher.js'
import {
hasGrowthBookEnvOverride,
@@ -173,7 +173,7 @@ import {
launchTeleportRepoMismatchDialog,
launchTeleportResumeWrapper,
} from './dialogLaunchers.js'
import { SHOW_CURSOR } from './ink/termio/dec.js'
import { SHOW_CURSOR } from '@anthropic/ink'
import {
exitWithError,
exitWithMessage,
@@ -3370,8 +3370,8 @@ async function run(): Promise<CommanderCommand> {
installAsciicastRecorder();
}
const { createRoot } = await import('./ink.js')
root = await createRoot(ctx.renderOptions)
const { createRoot } = await import('@anthropic/ink')
root = await createRoot(ctx.renderOptions)
// Log startup time now, before any blocking dialog renders. Logging
// from REPL's first render (the old location) included however long
@@ -6374,7 +6374,7 @@ async function run(): Promise<CommanderCommand> {
.action(async () => {
const [{ setupTokenHandler }, { createRoot }] = await Promise.all([
import('./cli/handlers/util.js'),
import('./ink.js'),
import('@anthropic/ink'),
])
const root = await createRoot(getBaseRenderOptions(false))
await setupTokenHandler(root)
@@ -6491,7 +6491,7 @@ async function run(): Promise<CommanderCommand> {
.action(async () => {
const [{ doctorHandler }, { createRoot }] = await Promise.all([
import('./cli/handlers/util.js'),
import('./ink.js'),
import('@anthropic/ink'),
])
const root = await createRoot(getBaseRenderOptions(false))
await doctorHandler(root)