mirror of
https://github.com/samsonjs/vibetunnel.git
synced 2026-04-27 15:17:38 +00:00
make file browser work without session
This commit is contained in:
parent
16bc60b379
commit
e82c633a9a
3 changed files with 12 additions and 4 deletions
|
|
@ -73,8 +73,8 @@ export class FileBrowser extends LitElement {
|
||||||
|
|
||||||
async connectedCallback() {
|
async connectedCallback() {
|
||||||
super.connectedCallback();
|
super.connectedCallback();
|
||||||
if (this.visible && this.session) {
|
if (this.visible) {
|
||||||
this.currentPath = this.session.workingDir || '.';
|
this.currentPath = this.session?.workingDir || '.';
|
||||||
await this.loadDirectory(this.currentPath);
|
await this.loadDirectory(this.currentPath);
|
||||||
}
|
}
|
||||||
document.addEventListener('keydown', this.handleKeyDown);
|
document.addEventListener('keydown', this.handleKeyDown);
|
||||||
|
|
@ -84,8 +84,8 @@ export class FileBrowser extends LitElement {
|
||||||
super.updated(changedProperties);
|
super.updated(changedProperties);
|
||||||
|
|
||||||
if (changedProperties.has('visible') || changedProperties.has('session')) {
|
if (changedProperties.has('visible') || changedProperties.has('session')) {
|
||||||
if (this.visible && this.session) {
|
if (this.visible) {
|
||||||
this.currentPath = this.session.workingDir || '.';
|
this.currentPath = this.session?.workingDir || '.';
|
||||||
await this.loadDirectory(this.currentPath);
|
await this.loadDirectory(this.currentPath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,8 @@ function showUsage() {
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function startVibeTunnelForward(args: string[]) {
|
export async function startVibeTunnelForward(args: string[]) {
|
||||||
|
console.log(`[fwd] Raw args received: ${JSON.stringify(args)}`);
|
||||||
|
|
||||||
// Parse command line arguments
|
// Parse command line arguments
|
||||||
if (args.length === 0 || args[0] === '--help' || args[0] === '-h') {
|
if (args.length === 0 || args[0] === '--help' || args[0] === '-h') {
|
||||||
showUsage();
|
showUsage();
|
||||||
|
|
@ -51,6 +53,8 @@ export async function startVibeTunnelForward(args: string[]) {
|
||||||
if (args[0] === '--session-id' && args.length > 1) {
|
if (args[0] === '--session-id' && args.length > 1) {
|
||||||
sessionId = args[1];
|
sessionId = args[1];
|
||||||
remainingArgs = args.slice(2);
|
remainingArgs = args.slice(2);
|
||||||
|
console.log(`[fwd] Parsed session ID: ${sessionId}`);
|
||||||
|
console.log(`[fwd] Remaining args after session ID: ${JSON.stringify(remainingArgs)}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
const monitorOnly = remainingArgs[0] === '--monitor-only';
|
const monitorOnly = remainingArgs[0] === '--monitor-only';
|
||||||
|
|
@ -66,6 +70,7 @@ export async function startVibeTunnelForward(args: string[]) {
|
||||||
|
|
||||||
console.log(`Starting command: ${command.join(' ')}`);
|
console.log(`Starting command: ${command.join(' ')}`);
|
||||||
console.log(`Working directory: ${cwd}`);
|
console.log(`Working directory: ${cwd}`);
|
||||||
|
console.log(`Session ID: ${sessionId || 'not provided'}`);
|
||||||
|
|
||||||
// Initialize PTY manager
|
// Initialize PTY manager
|
||||||
const controlPath = path.join(os.homedir(), '.vibetunnel', 'control');
|
const controlPath = path.join(os.homedir(), '.vibetunnel', 'control');
|
||||||
|
|
|
||||||
|
|
@ -74,6 +74,9 @@ export class PtyManager {
|
||||||
options: SessionOptions = {}
|
options: SessionOptions = {}
|
||||||
): Promise<SessionCreationResult> {
|
): Promise<SessionCreationResult> {
|
||||||
const sessionId = options.sessionId || uuidv4();
|
const sessionId = options.sessionId || uuidv4();
|
||||||
|
console.log(
|
||||||
|
`[PTY] Creating session - provided ID: ${options.sessionId}, using ID: ${sessionId}`
|
||||||
|
);
|
||||||
const sessionName = options.sessionName || path.basename(command[0]);
|
const sessionName = options.sessionName || path.basename(command[0]);
|
||||||
const workingDir = options.workingDir || process.cwd();
|
const workingDir = options.workingDir || process.cwd();
|
||||||
const term = options.term || this.defaultTerm;
|
const term = options.term || this.defaultTerm;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue