chore(upstream): PR4 - terminal ensureSession 手動移植 + bundle name sanitize#137
Merged
Merged
Conversation
…perset-sh#3252) Cherry-picked from upstream 54e8a1c (fix(desktop): prevent xterm garbling via tRPC-first terminal sessions). Only the terminal-related portion was taken; the quit lifecycle changes (setSkipQuitConfirmation / quitApp in main/index.ts and auto-updater.ts) were deliberately excluded because they collide with fork's independent requestQuit(mode: QuitMode) / GitHub API based auto-updater implementation. Changes: - Add terminal.ensureSession tRPC mutation in host-service - TerminalPane calls ensureSession before attaching WebSocket - WebSocket URL becomes stable (no workspaceId/themeType query params), preventing spurious reconnects that caused xterm rendering garbling on workspace switches - host-service WS handler retains query-param fallback for backwards compatibility with v1 callers Fork-specific decisions: - main/index.ts and auto-updater.ts intentionally left untouched - setSkipQuitConfirmation() helper NOT added to fork (fork uses prepareQuit('stop') instead)
…m upstream superset-sh#3253) Cherry-picked from upstream 146c86d (only the patch-dev-protocol.ts sanitize hunk). The rest of superset-sh#3253 is a quit lifecycle rewrite that conflicts with fork's requestQuit(mode) system and is intentionally NOT being taken. Workspace names with special characters (e.g. apostrophes) break PlistBuddy commands. Use an allowlist (alphanumeric, spaces, hyphens) instead of stripping individual characters.
MocA-Love
added a commit
that referenced
this pull request
Apr 10, 2026
All 28 upstream commits have been processed via cherry-pick across 7 PRs (#134-#140). This merge marks the git history as synchronized without changing any file content. === Cherry-picked (25 commits) === PR1 (#134): efc736f, a57f9fb, dfafa5a PR2 (#135): 97031ad, ed7fb56, abdcdc6, a8f560d, e0b99ef PR3 (#136): d98533c, 89d7903, d1ea876 PR4 (#137): 54e8a1c (terminal only), 146c86d (sanitize only) PR5 (#139): 14de45b, 5ac13af, 50e609f, b12c710, dbf8320 PR6 (#138): 7ab64a7, a876354, 5e1d432, ff57e31 PR7 (#140): cd25bee, fa861c4, 5b14771 === Intentionally not adopted (4 commits) === - 1298392 Fix auto update — fork uses GitHub API updater (IS_FORK=true) - 6daee83 unbreak autoupdate by removing close-to-hide — breaks fork tray UX - 146c86d quit lifecycle rewrite (main body) — destroys fork's QuitMode/requestQuit/cleanupMainWindowResources - 82236fa gitignore .mcp.json — fork tracks .mcp.json per AGENTS.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
当初の計画では「PR4 = auto-updater/quit 系4コミット取り込み」だったが、Codex 事前調査の結果、fork 独自実装 (
requestQuit(mode)/GitHub API ベース auto-updater/cleanupMainWindowResources()/ tray 二択メニュー) と 4コミットの大半が直接衝突することが判明した。そのため PR4 は方針を縮小し、実質的に価値があり fork 独自実装を壊さない部分のみを手動移植する。
取り込み内容
コミット1:
c3cdd68faterminal ensureSession tRPC mutation(upstream superset-sh#3252 部分)upstream
54e8a1c88から terminal 関連部分のみ抽出。quit lifecycle 変更は除外。目的: terminal session 作成を WebSocket query params → tRPC mutation に移行し、WebSocket URL を安定化。workspace 切替時の xterm 描画 garbling を修正。
取り込んだファイル:
packages/host-service/src/trpc/router/router.ts(+terminalRouter)packages/host-service/src/trpc/router/terminal/index.ts(新規)packages/host-service/src/trpc/router/terminal/terminal.ts(新規 ensureSession mutation)packages/host-service/src/terminal/terminal.ts(+export, WS handler のフォールバック処理)apps/desktop/src/renderer/.../TerminalPane/TerminalPane.tsx(ensureSession 呼び出し追加)意図的に除外したファイル:
apps/desktop/src/main/index.ts— upstream がsetSkipQuitConfirmation()/quitApp()を追加しようとするが、fork はrequestQuit(mode: QuitMode)/pendingQuitMode/prepareQuit('stop'|'release')を使用apps/desktop/src/main/lib/auto-updater.ts— fork はIS_FORK=trueで GitHub API ベース auto-updater に置換済み、prepareQuit('stop')で macOS quit ブロック回避host-service 側の WebSocket handler は query-param フォールバックを残したため、v1 callers との後方互換あり。
コミット2:
5f83081a6bundle display name sanitize(upstream superset-sh#3253 部分)upstream
146c86d73からpatch-dev-protocol.tsの sanitize hunk のみ抽出。quit lifecycle 書き換え本体は除外。目的: workspace 名に特殊文字(例: アポストロフィ)が含まれると PlistBuddy コマンドが壊れるバグ修正。allowlist (英数字・スペース・ハイフン) でサニタイズ。
スキップ確定コミット(取り込まない)
memory
project_upstream_merge_workflowに記録する:146c86d73本体 (superset-sh#3253)QuitMode/requestQuit/prepareQuit/cleanupMainWindowResources/closeLocalDb/shutdownExtensionHostを丸ごと捨てる方向。tray 二択メニューも消す。fork 独自 cleanup 体系が壊れる129839219(superset-sh#3278)IS_FORK=trueで GitHub Releases 外部オープン完結のため、upstream のquitAndInstall()起点修正が現行 runtime に効かない。commit 単体でも import/call が不整合(quitAppimport しつつsetSkipQuitConfirmation()呼ぶ)6daee831b(superset-sh#3291)54e8a1c88(superset-sh#3252) quit 部分Fork 独自要素(維持必須 - memoryにも記録済み)
cleanupMainWindowResources()@main/index.tsshutdownExtensionHost(),closeLocalDb()IS_FORK=trueGitHub API auto-updaterapp-command(マウス戻る/進む) @windows/main.tstray/index.tsQuitMode = "release" | "stop",prepareQuit('stop')(macOS quit ブロック回避)検証
bun run typecheck→ 既存のModelsSettings.tsxエラーのみTest plan