TEMP: log context distros/sessions + OSC7-reported cwd for diagnosis
This commit is contained in:
parent
50766c3fdd
commit
bbe827af22
2 changed files with 21 additions and 2 deletions
15
src/App.tsx
15
src/App.tsx
|
|
@ -770,7 +770,20 @@ export default function App() {
|
|||
}
|
||||
contextFetchingRef.current = true;
|
||||
try {
|
||||
setContextSessions(await getPaneContext(Array.from(distros)));
|
||||
const sessions = await getPaneContext(Array.from(distros));
|
||||
// TEMP diagnostic — remove once the context bar is confirmed working.
|
||||
console.log(
|
||||
"[ctx] distros",
|
||||
[...distros],
|
||||
"→",
|
||||
sessions.length,
|
||||
"sessions:",
|
||||
sessions.map(
|
||||
(s) =>
|
||||
`${s.cwd} | ${s.contextTokens}tok | ${Math.round((Date.now() - s.lastActiveMs) / 1000)}s ago`,
|
||||
),
|
||||
);
|
||||
setContextSessions(sessions);
|
||||
} catch (e) {
|
||||
console.warn("getPaneContext failed:", e);
|
||||
} finally {
|
||||
|
|
|
|||
|
|
@ -190,7 +190,13 @@ export default function LeafPane({ leaf }: { leaf: LeafNode }) {
|
|||
// which is the (often unset) spawn cwd and doesn't follow `cd`.
|
||||
const [liveCwd, setLiveCwd] = useState<string | null>(null);
|
||||
const onPaneCwd = useCallback(
|
||||
(cwd: string) => setLiveCwd((cur) => (cur === cwd ? cur : cwd)),
|
||||
(cwd: string) =>
|
||||
setLiveCwd((cur) => {
|
||||
if (cur === cwd) return cur;
|
||||
// TEMP diagnostic — remove once the context bar is confirmed working.
|
||||
console.log("[ctx] pane reported cwd via OSC7:", cwd);
|
||||
return cwd;
|
||||
}),
|
||||
[],
|
||||
);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue