Open terminal in currently active workspace

This commit is contained in:
Quinten Kock 2025-11-30 00:04:33 +01:00
parent 143576ba68
commit 62d5af3b1e
2 changed files with 6 additions and 1 deletions

View File

@ -19,6 +19,10 @@ type FolderTree = {
let currentWorkspaceRoot: string | null = null; let currentWorkspaceRoot: string | null = null;
let watcher: chokidar.FSWatcher | null = null; let watcher: chokidar.FSWatcher | null = null;
export function getCurrentWorkspaceRoot(): string | null {
return currentWorkspaceRoot;
}
// Helper to (re)create watcher and wire up IPC notifications to renderer // Helper to (re)create watcher and wire up IPC notifications to renderer
function ensureWatcher() { function ensureWatcher() {
if (watcher) return watcher; if (watcher) return watcher;

View File

@ -1,4 +1,5 @@
import * as pty from "node-pty"; import * as pty from "node-pty";
import { getCurrentWorkspaceRoot } from "./fileOperations";
export interface TerminalInstance { export interface TerminalInstance {
ptyProcess: pty.IPty; ptyProcess: pty.IPty;
@ -24,7 +25,7 @@ export class TerminalManager {
name: "xterm-color", name: "xterm-color",
cols: 80, cols: 80,
rows: 24, rows: 24,
cwd: process.cwd(), cwd: getCurrentWorkspaceRoot() || process.cwd(),
env: process.env, env: process.env,
}); });