skill-statusline 2.4.1 → 2.4.2

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
@@ -124,17 +124,17 @@ Stored in `~/.claude/statusline-config.json`:
124
124
 
125
125
  ## Architecture
126
126
 
127
- Two rendering engines the installer picks the right one for your platform:
127
+ Single entry point (`~/.claude/statusline-command.sh`) on all platforms. On Windows, it auto-delegates to the Node.js renderer:
128
128
 
129
- - **Windows**: Node.js renderer (`statusline-node.js`) single process, no subprocess spawning, ~30-50ms
130
- - **macOS/Linux**: Bash engine (`core.sh`) pure bash, zero dependencies, <50ms with caching
129
+ - **Windows**: `statusline-command.sh` detects Git Bash/MSYS2 exec `node statusline-node.js` (~30-50ms)
130
+ - **macOS/Linux**: `statusline-command.sh` exec `bash core.sh` (pure bash, <50ms with caching)
131
131
 
132
132
  Git Bash on Windows has ~50-100ms overhead *per subprocess spawn* (awk, sed, grep, git, date). A bash statusline spawning 10-20 subprocesses = 500-1000ms. The Node.js renderer eliminates this by doing everything in a single process.
133
133
 
134
134
  ```
135
135
  ~/.claude/
136
- statusline-command.sh # Bash entry point (macOS/Linux)
137
- statusline-node.js # Node.js renderer (Windows)
136
+ statusline-command.sh # Entry point (all platforms)
137
+ statusline-node.js # Node.js renderer (auto-used on Windows)
138
138
  statusline/
139
139
  core.sh # Bash engine: parse JSON, compute fields, render
140
140
  json-parser.sh # Nested JSON extraction (no jq)
package/bin/cli.js CHANGED
@@ -9,7 +9,7 @@ const readline = require('readline');
9
9
  const args = process.argv.slice(2);
10
10
  const command = args[0];
11
11
  const subcommand = args[1];
12
- const VERSION = '2.4.1';
12
+ const VERSION = '2.4.2';
13
13
 
14
14
  const PKG_DIR = path.resolve(__dirname, '..');
15
15
  const HOME = os.homedir();
@@ -114,12 +114,13 @@ function getClaudeMdSection() {
114
114
  const isWin = process.platform === 'win32';
115
115
  const howItWorks = isWin
116
116
  ? `### How It Works
117
- - \`~/.claude/settings.json\` → runs \`node ~/.claude/statusline-node.js\`
118
- - \`~/.claude/statusline-node.js\` → Node.js renderer (fast on Windows, no bash overhead)
117
+ - \`~/.claude/settings.json\` → runs \`~/.claude/statusline-command.sh\`
118
+ - \`~/.claude/statusline-command.sh\` → detects Windows, delegates to Node.js renderer
119
+ - \`~/.claude/statusline-node.js\` → Node.js renderer (fast on Windows, no bash subprocess overhead)
119
120
  - \`~/.claude/statusline-config.json\` → user preferences (theme, layout, options)`
120
121
  : `### How It Works
121
- - \`~/.claude/settings.json\` → points to \`bash ~/.claude/statusline-command.sh\`
122
- - \`~/.claude/statusline-command.sh\` → entry point, delegates to v2 engine
122
+ - \`~/.claude/settings.json\` → runs \`~/.claude/statusline-command.sh\`
123
+ - \`~/.claude/statusline-command.sh\` → entry point, delegates to v2 bash engine
123
124
  - \`~/.claude/statusline/core.sh\` → v2 engine (themes, layouts, accurate context tracking)
124
125
  - \`~/.claude/statusline-config.json\` → user preferences (theme, layout, options)`;
125
126
 
@@ -375,27 +376,20 @@ async function install() {
375
376
  success(`Config: theme=${CYN}${config.theme}${R}, layout=${CYN}${config.layout}${R}`);
376
377
 
377
378
  // Update settings.json
379
+ // Use ~/.claude/statusline-command.sh on ALL platforms
380
+ // Claude Code on Windows runs commands through Git Bash, which resolves ~
381
+ // The bash script detects Windows and delegates to Node.js renderer automatically
378
382
  const settings = readSettings();
379
383
  const prevCmd = settings.statusLine?.command || '';
384
+ const expectedCmd = '~/.claude/statusline-command.sh';
380
385
  const needsUpdate = !settings.statusLine
381
- || prevCmd === 'bash ~/.claude/statusline-command.sh'
382
- || (isWin && prevCmd.includes('bash.exe'))
383
- || (isWin && prevCmd.includes('\\\\'));
386
+ || prevCmd !== expectedCmd;
384
387
  if (needsUpdate) {
385
- let cmd;
386
- if (isWin) {
387
- // Windows: use Node.js renderer directly — avoids Git Bash/MSYS2 overhead
388
- // (~50-100ms per subprocess spawn in Git Bash vs single Node.js process)
389
- const nodeScript = path.join(CLAUDE_DIR, 'statusline-node.js');
390
- cmd = `node "${nodeScript.replace(/\\/g, '/')}"`;
391
- } else {
392
- cmd = 'bash ~/.claude/statusline-command.sh';
393
- }
394
- settings.statusLine = { type: 'command', command: cmd };
388
+ settings.statusLine = { type: 'command', command: expectedCmd };
395
389
  writeSettings(settings);
396
390
  success(`${B}statusLine${R} config added to settings.json`);
397
391
  if (isWin) {
398
- info(`Using Node.js renderer (fast on Windows)`);
392
+ info(`Windows: auto-delegates to Node.js renderer (fast)`);
399
393
  }
400
394
  } else {
401
395
  success(`statusLine already configured in settings.json`);
@@ -436,10 +430,10 @@ async function install() {
436
430
  }
437
431
 
438
432
  blank();
433
+ bar(`Script: ${R}${CYN}~/.claude/statusline-command.sh${R}`);
439
434
  if (isWin) {
440
- bar(`Renderer: ${R}${CYN}~/.claude/statusline-node.js${R} ${D}(Node.js)${R}`);
435
+ bar(`Renderer: ${R}${CYN}~/.claude/statusline-node.js${R} ${D}(Node.js — auto on Windows)${R}`);
441
436
  } else {
442
- bar(`Script: ${R}${CYN}~/.claude/statusline-command.sh${R}`);
443
437
  bar(`Engine: ${R}${CYN}~/.claude/statusline/core.sh${R}`);
444
438
  }
445
439
  bar(`Config: ${R}${CYN}~/.claude/statusline-config.json${R}`);
package/bin/statusline.sh CHANGED
@@ -1,8 +1,18 @@
1
1
  #!/usr/bin/env bash
2
- # skill-statusline v2.0 — Entry point
3
- # Delegates to modular v2 engine if installed, falls back to v1 inline
2
+ # skill-statusline v2.4 — Entry point
3
+ # On Windows: delegates to Node.js renderer (avoids Git Bash subprocess overhead)
4
+ # On Unix: delegates to modular v2 bash engine
4
5
 
5
6
  STATUSLINE_DIR="${HOME}/.claude/statusline"
7
+ NODE_RENDERER="${HOME}/.claude/statusline-node.js"
8
+
9
+ # Windows detection: MSYS, MINGW, or CYGWIN environment (Git Bash)
10
+ if [[ "$OSTYPE" == msys* ]] || [[ "$OSTYPE" == mingw* ]] || [[ "$OSTYPE" == cygwin* ]] || [[ -n "$MSYSTEM" ]]; then
11
+ # Use Node.js renderer — single process, no subprocess overhead
12
+ if [ -f "$NODE_RENDERER" ] && command -v node &>/dev/null; then
13
+ exec node "$NODE_RENDERER"
14
+ fi
15
+ fi
6
16
 
7
17
  if [ -f "${STATUSLINE_DIR}/core.sh" ]; then
8
18
  # v2: modular engine with themes, layouts, accurate context
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skill-statusline",
3
- "version": "2.4.1",
3
+ "version": "2.4.2",
4
4
  "description": "Rich, themeable statusline for Claude Code — accurate context tracking, 5 themes, 3 layouts, token/cost/GitHub/skill display. Node.js renderer on Windows (no bash overhead), pure bash on Unix.",
5
5
  "bin": {
6
6
  "skill-statusline": "bin/cli.js",