ccstatusline-zh 2.2.7 → 2.2.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -84,22 +84,26 @@ bun install -g ccstatusline-zh
84
84
 
85
85
  ### 配置 Claude Code
86
86
 
87
- 在 Claude Code 设置中添加状态栏 Hook。编辑 `~/.claude/settings.json`:
87
+ 在 Claude Code 设置中添加状态栏配置。编辑 `~/.claude/settings.json`:
88
88
 
89
89
  ```json
90
90
  {
91
- "hooks": {
92
- "StatusLine": [
93
- {
94
- "matcher": "",
95
- "hooks": [
96
- {
97
- "type": "command",
98
- "command": "ccstatusline-zh"
99
- }
100
- ]
101
- }
102
- ]
91
+ "statusLine": {
92
+ "type": "command",
93
+ "command": "ccstatusline-zh",
94
+ "padding": 0
95
+ }
96
+ }
97
+ ```
98
+
99
+ 如果使用 `npx` 或 `bunx` 运行,可以使用以下命令:
100
+
101
+ ```json
102
+ {
103
+ "statusLine": {
104
+ "type": "command",
105
+ "command": "npx -y ccstatusline-zh@latest",
106
+ "padding": 0
103
107
  }
104
108
  }
105
109
  ```
@@ -127,7 +131,7 @@ ccstatusline-zh 完整支持 Windows 系统。安装方式相同:
127
131
  npm install -g ccstatusline-zh
128
132
  ```
129
133
 
130
- Windows 下 Claude Code 的 Hook 配置路径为 `%USERPROFILE%\.claude\settings.json`。
134
+ Windows 下 Claude Code 的配置路径为 `%USERPROFILE%\.claude\settings.json`。
131
135
 
132
136
  ---
133
137
 
@@ -135,7 +139,7 @@ Windows 下 Claude Code 的 Hook 配置路径为 `%USERPROFILE%\.claude\settings
135
139
 
136
140
  ### 基本用法
137
141
 
138
- 安装并配置 Hook 后,ccstatusline-zh 会在每次 Claude Code 更新状态时自动运行。状态数据通过 stdin 以 JSON 格式传入。
142
+ 安装并配置 statusLine 后,ccstatusline-zh 会在每次 Claude Code 更新状态时自动运行。状态数据通过 stdin 以 JSON 格式传入。
139
143
 
140
144
  ### 手动测试
141
145
 
@@ -53882,7 +53882,7 @@ function getTerminalWidth() {
53882
53882
  function canDetectTerminalWidth() {
53883
53883
  return probeTerminalWidth() !== null;
53884
53884
  }
53885
- var __dirname = "/Users/bytedance/Documents/code/bytedance/ccstatusline-zh/src/utils", PACKAGE_VERSION = "2.2.7";
53885
+ var __dirname = "/Users/bytedance/Documents/code/bytedance/ccstatusline-zh/src/utils", PACKAGE_VERSION = "2.2.8";
53886
53886
  var init_terminal = () => {};
53887
53887
 
53888
53888
  // src/utils/renderer.ts
@@ -67086,7 +67086,8 @@ var PowerlineThemeSelector = ({
67086
67086
  // src/tui/components/PowerlineSetup.tsx
67087
67087
  var jsx_dev_runtime17 = __toESM(require_jsx_dev_runtime(), 1);
67088
67088
  function formatPowerlineMenuLabel(label) {
67089
- const displayWidth = [...label].reduce((w, ch) => w + (ch.charCodeAt(0) > 127 ? 2 : 1), 0);
67089
+ const segmenter2 = new Intl.Segmenter;
67090
+ const displayWidth = Array.from(segmenter2.segment(label)).reduce((w, { segment: ch }) => w + ((ch.codePointAt(0) ?? 0) > 127 ? 2 : 1), 0);
67090
67091
  const targetWidth = 10;
67091
67092
  const padCount = Math.max(0, targetWidth - displayWidth);
67092
67093
  return label + " ".repeat(padCount);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccstatusline-zh",
3
- "version": "2.2.7",
3
+ "version": "2.2.8",
4
4
  "description": "ccstatusline 的中文汉化版 - Claude Code CLI 可定制状态栏格式化工具",
5
5
  "module": "src/ccstatusline.ts",
6
6
  "type": "module",