mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-22 16:25:51 +00:00
fix: 解决 node 下 loading 按钮计算错误问题
This commit is contained in:
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@@ -27,7 +27,7 @@ jobs:
|
|||||||
run: bun test --coverage --coverage-reporter=lcov
|
run: bun test --coverage --coverage-reporter=lcov
|
||||||
|
|
||||||
- name: Upload coverage to Codecov
|
- name: Upload coverage to Codecov
|
||||||
uses: codecov/codecov-action@v3
|
uses: codecov/codecov-action@v5
|
||||||
with:
|
with:
|
||||||
file: ./coverage/lcov.info
|
file: ./coverage/lcov.info
|
||||||
token: ${{ secrets.CODECOV_TOKEN }}
|
token: ${{ secrets.CODECOV_TOKEN }}
|
||||||
|
|||||||
@@ -597,7 +597,7 @@ function renderSystemMessage(text) {
|
|||||||
const LOADING_ID = "loading-indicator";
|
const LOADING_ID = "loading-indicator";
|
||||||
|
|
||||||
// TUI star spinner frames (same as Claude Code CLI)
|
// TUI star spinner frames (same as Claude Code CLI)
|
||||||
const SPINNER_FRAMES = ["·", "✢", "✳", "✶", "✻", "✽"];
|
const SPINNER_FRAMES = ["·", "✢", "✱", "✶", "✻", "✽"];
|
||||||
const SPINNER_CYCLE = [...SPINNER_FRAMES, ...SPINNER_FRAMES.slice().reverse()];
|
const SPINNER_CYCLE = [...SPINNER_FRAMES, ...SPINNER_FRAMES.slice().reverse()];
|
||||||
|
|
||||||
// 204 verbs from TUI src/constants/spinnerVerbs.ts
|
// 204 verbs from TUI src/constants/spinnerVerbs.ts
|
||||||
|
|||||||
@@ -3,11 +3,13 @@ import type { RGBColor as RGBColorType } from './types.js'
|
|||||||
|
|
||||||
export function getDefaultCharacters(): string[] {
|
export function getDefaultCharacters(): string[] {
|
||||||
if (process.env.TERM === 'xterm-ghostty') {
|
if (process.env.TERM === 'xterm-ghostty') {
|
||||||
return ['·', '✢', '✳', '✶', '✻', '*'] // Use * instead of ✽ for Ghostty because the latter renders in a way that's slightly offset
|
return ['·', '✢', '✱', '✶', '✻', '*'] // ✱ replaces ✳ (emoji, renders offset in Ghostty); * replaces ✽ (same)
|
||||||
}
|
}
|
||||||
|
// ✳ (U+2733) is matched by emoji-regex in Node.js → stringWidth returns 2 instead of 1,
|
||||||
|
// causing layout jitter when the spinner cycles frames. ✱ (U+2731) is visually similar but not emoji.
|
||||||
return process.platform === 'darwin'
|
return process.platform === 'darwin'
|
||||||
? ['·', '✢', '✳', '✶', '✻', '✽']
|
? ['·', '✢', '✱', '✶', '✻', '✽']
|
||||||
: ['·', '✢', '*', '✶', '✻', '✽']
|
: ['·', '✢', '✱', '✶', '✻', '✽']
|
||||||
}
|
}
|
||||||
|
|
||||||
// Interpolate between two RGB colors
|
// Interpolate between two RGB colors
|
||||||
|
|||||||
Reference in New Issue
Block a user