Open terminal in currently active workspace
This commit is contained in:
parent
143576ba68
commit
62d5af3b1e
|
|
@ -19,6 +19,10 @@ type FolderTree = {
|
|||
let currentWorkspaceRoot: string | 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
|
||||
function ensureWatcher() {
|
||||
if (watcher) return watcher;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import * as pty from "node-pty";
|
||||
import { getCurrentWorkspaceRoot } from "./fileOperations";
|
||||
|
||||
export interface TerminalInstance {
|
||||
ptyProcess: pty.IPty;
|
||||
|
|
@ -24,7 +25,7 @@ export class TerminalManager {
|
|||
name: "xterm-color",
|
||||
cols: 80,
|
||||
rows: 24,
|
||||
cwd: process.cwd(),
|
||||
cwd: getCurrentWorkspaceRoot() || process.cwd(),
|
||||
env: process.env,
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue