Skip to content

Commit 3a6b531

Browse files
authored
Show last path of project dir (#20)
1 parent 5cdef33 commit 3a6b531

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

renderer.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import {ipcRenderer} from "electron";
33
import {Terminal} from "xterm";
44
import {PersistedSession, SessionConfig, SessionType} from "./types";
55
import {isClaudeSessionReady} from "./terminal-utils";
6+
import * as path from "path";
67

78
interface Session {
89
id: string;
@@ -915,7 +916,9 @@ document.getElementById("new-session")?.addEventListener("click", async () => {
915916

916917
if (lastSettings.projectDir) {
917918
selectedDirectory = lastSettings.projectDir;
918-
projectDirInput.value = lastSettings.projectDir;
919+
// Show last part of path in parentheses before full path
920+
const dirName = path.basename(lastSettings.projectDir);
921+
projectDirInput.value = `(${dirName}) ${lastSettings.projectDir}`;
919922

920923
// Load git branches for the last directory
921924
await loadAndPopulateBranches(lastSettings.projectDir, lastSettings.parentBranch);
@@ -971,7 +974,9 @@ browseDirBtn?.addEventListener("click", async () => {
971974
const dir = await ipcRenderer.invoke("select-directory");
972975
if (dir) {
973976
selectedDirectory = dir;
974-
projectDirInput.value = dir;
977+
// Show last part of path in parentheses before full path
978+
const dirName = path.basename(dir);
979+
projectDirInput.value = `(${dirName}) ${dir}`;
975980

976981
// Load git branches
977982
await loadAndPopulateBranches(dir);

0 commit comments

Comments
 (0)