Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion src/ccstatusline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import {
preRenderAllWidgets,
renderStatusLine
} from './utils/renderer';
import { initScope } from './utils/scope';
import { advanceGlobalSeparatorIndex } from './utils/separator-index';
import { getSkillsMetrics } from './utils/skills';
import {
Expand Down Expand Up @@ -312,7 +313,8 @@ async function main() {
}

// Parse --config before anything else
initConfigPath(parseConfigArg());
const explicitConfigPath = parseConfigArg();
initConfigPath(explicitConfigPath);

// Handle --hook mode (cross-platform hook handler for widgets)
if (process.argv.includes('--hook')) {
Expand All @@ -322,6 +324,13 @@ async function main() {

// Check if we're in a piped/non-TTY environment first
if (!process.stdin.isTTY) {
// Project installs use an absolute .claude/ccstatusline.json --config.
// Restore that scope before rendering so migration/update-message writes
// synchronize hooks with the project's settings.local.json.
initScope({
explicitConfigPath,
inferProjectFromExplicitConfig: true
});
await ensureWindowsUtf8CodePage();

// We're receiving piped input
Expand All @@ -346,6 +355,8 @@ async function main() {
}
} else {
// Interactive mode - run TUI
initScope({ explicitConfigPath, detectProject: true });

// Remove updatemessage before running TUI
const settings = await loadSettings();
if (settings.updatemessage) {
Expand Down
Loading