Skip to content

fix(server): resolve the configured shell for session terminals - #61389

Closed
Tsuki-hash wants to merge 1 commit into
anomalyco:devfrom
Tsuki-hash:session-terminal-shell
Closed

Tsuki-hash wants to merge 1 commit into
anomalyco:devfrom
Tsuki-hash:session-terminal-shell

Conversation

@Tsuki-hash

Copy link
Copy Markdown

Resolves the configured shell for session terminals created without an explicit command, instead of falling back to $SHELL.

Previously persistentPty.create passed only ctx.payload.command through, so a terminal opened without a command (for example ctrl+x t in the web UI) fell back to ShellSelect.environment(), which ignores the configured shell. This is the root cause of #51051, and it resurfaced in 2.2.5 when #60346 moved the desktop terminal to persistent PTYs, since that path resolves the shell the same way.

Fixes #51051.
Supersedes #51052 (closed by the automated cleanup, not on its merits; its fork branch is gone, so this is a fresh resubmission of the same fix against current dev).

Test plan

  • Added a smoke test: a terminal created without a command uses the configured shell and prints its output.

Visual

<svg xmlns="http://www.w3.org/2000/svg" width="240" height="72" viewBox="0 0 240 72">
  <rect x="4" y="4" width="232" height="64" rx="10" fill="none" stroke="currentColor" opacity="0.35"/>
  <circle cx="20" cy="18" r="4" fill="currentColor" opacity="0.5"/>
  <circle cx="34" cy="18" r="4" fill="currentColor" opacity="0.5"/>
  <circle cx="48" cy="18" r="4" fill="currentColor" opacity="0.5"/>
  <text x="16" y="48" font-family="monospace" font-size="14" fill="currentColor">$ configured-shell</text>
  <rect x="164" y="38" width="8" height="14" fill="currentColor">
    <animate attributeName="opacity" values="1;0;1" dur="1.2s" repeatCount="indefinite"/>
  </rect>
</svg>

@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label Nov 3, 2026
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

Please edit this PR description to address the above within 72 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

@opencodejr opencodejr Bot closed this Nov 3, 2026
@opencodejr

opencodejr Bot commented Nov 3, 2026

Copy link
Copy Markdown

Thanks for coming back to this, and for the original fix in #51052. I think this duplicates #61353, which fixes the same issue (#51051) in the same persistentPty.create handler and is still open and being worked on.

One thing to know: #61353 started with the same approach as this PR, yielding ShellSelect.Service directly in the handler. A reviewer found that this made every terminal create fail with a 500, because the experimental persistent-pty routes don't run the location middleware that provides that service. It now resolves the shell in the session's location instead (sessionInfo → instances.provide, after awaitPlugins).

You clearly know this code well, so reviewing or testing #61353 (especially on Windows, where the bug shows up most) would be really helpful. If you think it's missing something, please comment there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs:compliance This means the issue will auto-close after 2 hours.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

session terminal ignores the "shell" config option (always PowerShell on Windows)

1 participant