Skip to content
Merged
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
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>io.github.nbclaudecodegui</groupId>
<artifactId>netbeans-claude-code-gui</artifactId>
<version>0.21.52-SNAPSHOT</version>
<version>0.21.53-SNAPSHOT</version>
<packaging>nbm</packaging>
<name>Netbeans Claude Code GUI</name>
<description>NetBeans plugin that provides a GUI for Claude Code CLI — run claude code sessions directly inside the IDE.</description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1222,6 +1222,9 @@ public boolean hasLiveProcess() {
return claudeProcess != null && claudeProcess.isRunning();
}

/** Returns the timestamp (ms) when the current PTY process was launched, or 0 if none. */
public long getProcessStartedAt() { return processStartedAt; }

/**
* Reads the Claude CLI version string from the running process.
*
Expand Down
10 changes: 8 additions & 2 deletions src/main/java/io/github/nbclaudecodegui/ui/ClaudeSessionTab.java
Original file line number Diff line number Diff line change
Expand Up @@ -974,8 +974,14 @@ public void openSwitchDialog(SessionMode initialMode) {
io.github.nbclaudecodegui.model.SavedSession recent =
io.github.nbclaudecodegui.process.ClaudeSessionStore.findMostRecent(
workingDir.toPath(), claudeConfigDir);
String currentName = recent != null ? recent.displayName() : "";
String currentId = recent != null ? recent.sessionId() : null;
long procStart = controller.getProcessStartedAt();
// If a process is running and the most recent JSONL predates it, it's an OLD session —
// not the currently running one (which hasn't written its JSONL yet)
boolean isCurrentSession = recent != null
&& (procStart == 0 || (recent.lastAt() != null
&& recent.lastAt().toEpochMilli() >= procStart));
String currentName = isCurrentSession ? recent.displayName() : "";
String currentId = isCurrentSession ? recent.sessionId() : null;

final ClaudeSessionTab self = this;
final Path configDir = claudeConfigDir;
Expand Down
Loading