mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-11-15 10:59:32 +01:00
fix(terminal): report the pane directory in the workspace's own spelling
tmux reads a pane's directory from the process cwd, which is always the resolved path, while workingDir keeps the spelling the case was created with. For a workspace reached through a symlink every reading looked like it was outside the workspace, so the browser sent each relative link through the attachment route instead of the workspace routes. Each session now resolves workingDir once in the background, bounded by probePathKind() and a timed realpath(), and setCwd() writes a reading at or under the resolved path back in workingDir's spelling. Until that settles only a reading lexically inside workingDir is taken. An unknown probe or a failed realpath leaves readings untranslated and retries after WORKSPACE_REALPATH_RETRY_MS. Also corrects two comments: cwd is written to state.json but never read back, and a blank pane path is usually a pane whose program exited.
This commit is contained in:
1 parent
54c1692350
commit
f23e18b1fc
6 files changed
+237
-9
No files matched your search
@@ -46,3 +46,10 @@ export const MAX_STALLED_PATH_PROBES = Math.min(
|
||||
PATH_PROBE_STALL_CEILING,
|
||||
envInt('CODEMAN_PATH_PROBE_MAX_STALLED', Math.max(1, PATH_PROBE_STALL_CEILING - 1), 1, 64)
|
||||
);
|
||||
|
||||
/**
|
||||
* How long a session waits before trying again to resolve its workspace's symlinks
|
||||
* after the folder did not answer, so a mount that recovers is picked up (the pane
|
||||
* directory reading stays in the resolved spelling meanwhile).
|
||||
*/
|
||||
export const WORKSPACE_REALPATH_RETRY_MS = 60_000;
|
||||
Reference in new issue
Block a user