mirror of
https://github.com/samsonjs/vibetunnel.git
synced 2026-04-27 15:17:38 +00:00
Restore attachedViaVT property to distinguish VibeTunnel sessions
- Add attachedViaVT to SessionInfo interface to identify nested sessions - Set attachedViaVT=true when VIBETUNNEL_SESSION_ID env var is present - Add property to Swift ServerSessionInfo for API compatibility - Allows distinguishing between direct terminal sessions and those spawned from within VibeTunnel
This commit is contained in:
parent
03c5638f21
commit
d75e2ffd76
3 changed files with 11 additions and 0 deletions
|
|
@ -36,6 +36,7 @@ struct ServerSessionInfo: Codable {
|
||||||
let remoteId: String?
|
let remoteId: String?
|
||||||
let remoteName: String?
|
let remoteName: String?
|
||||||
let remoteUrl: String?
|
let remoteUrl: String?
|
||||||
|
let attachedViaVT: Bool?
|
||||||
|
|
||||||
var isRunning: Bool {
|
var isRunning: Bool {
|
||||||
status == "running"
|
status == "running"
|
||||||
|
|
|
||||||
|
|
@ -335,6 +335,9 @@ export class PtyManager extends EventEmitter {
|
||||||
logger.debug(chalk.blue(`Creating PTY session with command: ${resolvedCommand.join(' ')}`));
|
logger.debug(chalk.blue(`Creating PTY session with command: ${resolvedCommand.join(' ')}`));
|
||||||
logger.debug(`Working directory: ${workingDir}`);
|
logger.debug(`Working directory: ${workingDir}`);
|
||||||
|
|
||||||
|
// Check if this session is being spawned from within VibeTunnel
|
||||||
|
const attachedViaVT = !!process.env.VIBETUNNEL_SESSION_ID;
|
||||||
|
|
||||||
// Create initial session info with resolved command
|
// Create initial session info with resolved command
|
||||||
const sessionInfo: SessionInfo = {
|
const sessionInfo: SessionInfo = {
|
||||||
id: sessionId,
|
id: sessionId,
|
||||||
|
|
@ -354,6 +357,7 @@ export class PtyManager extends EventEmitter {
|
||||||
gitHasChanges: options.gitHasChanges,
|
gitHasChanges: options.gitHasChanges,
|
||||||
gitIsWorktree: options.gitIsWorktree,
|
gitIsWorktree: options.gitIsWorktree,
|
||||||
gitMainRepoPath: options.gitMainRepoPath,
|
gitMainRepoPath: options.gitMainRepoPath,
|
||||||
|
attachedViaVT,
|
||||||
};
|
};
|
||||||
|
|
||||||
// Save initial session info
|
// Save initial session info
|
||||||
|
|
|
||||||
|
|
@ -84,6 +84,12 @@ export interface SessionInfo {
|
||||||
gitStagedCount?: number; // Number of staged files
|
gitStagedCount?: number; // Number of staged files
|
||||||
gitAddedCount?: number; // Number of added files
|
gitAddedCount?: number; // Number of added files
|
||||||
gitDeletedCount?: number; // Number of deleted files
|
gitDeletedCount?: number; // Number of deleted files
|
||||||
|
/**
|
||||||
|
* Whether this session was spawned from within VibeTunnel itself.
|
||||||
|
* Used to distinguish between direct terminal sessions and nested VibeTunnel sessions.
|
||||||
|
* Sessions with attachedViaVT=true are spawned from within an existing VibeTunnel session.
|
||||||
|
*/
|
||||||
|
attachedViaVT?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue