spawn terminal panes in the open workspace root (T-381)

The shell spawned with Directory.current — $HOME for desktop-entry
launches, and stale after a project switch since the process CWD
never moves. Use the kernel project root, falling back to the
process CWD only when no project is open.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-06-12 01:06:45 +02:00
co-authored by Claude Fable 5
parent 5f9c054420
commit 5d9443d9f7
5 changed files with 45 additions and 1 deletions
+3 -1
View File
@@ -78,7 +78,9 @@ class _TerminalPaneState extends State<TerminalPane> {
}
final shell = Platform.environment['SHELL'] ?? '/bin/bash';
final cwd = Directory.current.path;
// The open workspace, not Directory.current — a desktop launch starts
// in $HOME and a project switch doesn't move the process CWD (T-381).
final cwd = _kernel?.project.current?.path ?? Directory.current.path;
final response = await ipc.request(
'pane.spawn',