Skip to content

Commit c68184d

Browse files
m-mcgowanclaude
andcommitted
refactor: Decouple terminal title from task-objective widget
Inline the task directory path instead of importing from TaskObjective.ts, so the terminal title feature can be merged independently. The {task} placeholder gracefully resolves to empty when no task files exist. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 9bfb2a4 commit c68184d

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/utils/terminal-title.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
import { readFileSync } from 'fs';
2+
import { homedir } from 'os';
23
import { basename, join } from 'path';
34

45
import type { RenderContext } from '../types/RenderContext';
5-
import { getTaskDir } from '../widgets/TaskObjective';
66

77
import { runGit } from './git';
88

9+
const TASK_DIR = join(homedir(), '.cache', 'ccstatusline', 'tasks');
10+
911
function getTaskFromFile(sessionId: string): string | null {
1012
try {
11-
const content = readFileSync(join(getTaskDir(), `claude-task-${sessionId}`), 'utf8').trim();
13+
const content = readFileSync(join(TASK_DIR, `claude-task-${sessionId}`), 'utf8').trim();
1214
if (!content) return null;
1315
try {
1416
const data = JSON.parse(content) as { task?: string };

0 commit comments

Comments
 (0)