Skip to content

fix: apply workspace connection/cwd to new tabs & starter tab; bump version to 0.14.6#18

Merged
lyx-tec merged 1 commit into
mainfrom
fix/workspace-defaults-tab-session
Jul 13, 2026
Merged

fix: apply workspace connection/cwd to new tabs & starter tab; bump version to 0.14.6#18
lyx-tec merged 1 commit into
mainfrom
fix/workspace-defaults-tab-session

Conversation

@lyx-tec

@lyx-tec lyx-tec commented Jul 13, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes the workspace connection/cwd defaults not being applied in two places, and bumps the app version so remote wsh binaries are redeployed.

1. Workspace defaults applied to new tabs

pkg/wcore/workspace.go CreateTab now re-fetches the tab from the DB after ApplyPortableLayout before calling applyWorkspaceDefaultsToBlocks. Previously the in-memory tab variable retained an empty BlockIds (the layout only persists the block ids to the database), so applyWorkspaceDefaultsToBlocks iterated over zero blocks and never applied the workspace connection/cwd.

2. Workspace cwd only applied on matching connection

applyWorkspaceDefaultsToBlocks now only sets cmd:cwd (term) / file:cwd (file browser) when the block's effective connection equals the workspace's DefaultConnName. A block already on a different connection keeps its own cwd / remote home directory (per requirement).

3. Workspace defaults applied to the starter tab

pkg/wcore/layout.go BootstrapStarterLayout now re-fetches the tab and applies applyWorkspaceDefaultsToBlocks so the initial starter tab also picks up the workspace connection/cwd.

4. Version bump 0.14.5 -> 0.14.6

The job manager on the remote host applies a job's working directory (SSH session cwd) in pkg/jobmanager/jobcmd.go, which was added after the 0.14.5 release. Because conncontroller.IsWshVersionUpToDate uses a semver comparison, a remote already running wsh v0.14.5 was considered up-to-date and never redeployed, so SSH sessions silently started in $HOME instead of the configured cwd. Bumping the version forces wavesrv to redeploy the fresh wsh binary, which honors the job cwd.

Root-cause note (debugging history)

The session-cwd symptom was not a frontend/backend plumbing bug. startNewJob already reads the block's cmd:cwd from block meta; the real blocker was the stale remote wsh binary ignoring the job cwd. Intermediate fix attempts that added cwd plumbing to the session-create RPC were removed as redundant after confirming the version bump resolves the issue. Final diff is intentionally minimal.

Test plan

  • Create a new tab in a workspace with a configured SSH connection + cwd: term block opens on that connection in that cwd.
  • Convert an existing term block (SSH) to a session: session starts in the block's current cwd.
  • New tab / starter tab on a block whose connection differs from the workspace default: workspace cwd is NOT forced.
  • After update, confirm remote wsh is redeployed (version reported as 0.14.6) and SSH session cwd is honored.

… version to 0.14.6

- workspace.CreateTab: re-fetch tab after ApplyPortableLayout so workspace
  defaults are applied to the actual created blocks
- applyWorkspaceDefaultsToBlocks: only apply workspace cwd when block connection
  matches the workspace default connection
- layout.BootstrapStarterLayout: apply workspace defaults to starter tab
- bump version to 0.14.6 so remote wsh is redeployed (job manager now honors
  session/job cwd that was previously ignored on stale remote binaries)
@lyx-tec
lyx-tec merged commit ddff5f7 into main Jul 13, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant