Skip to content

Commit 5897608

Browse files
committed
πŸ€– feat: set terminal window title to show project/workspace name
Updated terminal-window.tsx to fetch workspace metadata and set document.title to 'Terminal β€” project/workspace' instead of showing the raw URL in browser tabs. Falls back to workspace ID if metadata can't be fetched. Generated with `mux`
1 parent ea25cc7 commit 5897608

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

β€Žsrc/terminal-window.tsxβ€Ž

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,22 @@ if (!workspaceId) {
2525
</div>
2626
`;
2727
} else {
28+
// Set document title for browser tab
29+
// Fetch workspace metadata to get a better title
30+
if (window.api) {
31+
window.api.workspace.getMetadata(workspaceId).then((metadata) => {
32+
if (metadata) {
33+
document.title = `Terminal β€” ${metadata.projectName}/${metadata.name}`;
34+
} else {
35+
document.title = `Terminal β€” ${workspaceId}`;
36+
}
37+
}).catch(() => {
38+
document.title = `Terminal β€” ${workspaceId}`;
39+
});
40+
} else {
41+
document.title = `Terminal β€” ${workspaceId}`;
42+
}
43+
2844
// Don't use StrictMode for terminal windows to avoid double-mounting issues
2945
// StrictMode intentionally double-mounts components in dev, which causes
3046
// race conditions with WebSocket connections and terminal lifecycle

0 commit comments

Comments
Β (0)