Skip to content

feat(windows): multi-session terminal (#31) - #34

Closed
milestone-17 wants to merge 1 commit into
1lck:integration/windowsfrom
milestone-17:feat/windows/terminal-sessions
Closed

milestone-17 wants to merge 1 commit into
1lck:integration/windowsfrom
milestone-17:feat/windows/terminal-sessions

Conversation

@milestone-17

Copy link
Copy Markdown
Contributor

Single hardcoded ConPTY session → TerminalModel managing N sessions, rendered by a new tabbed TerminalPanel.

  • Port / transport: TerminalTransport gains lifecycle states (Starting/Running/Failed/Finished) + operationID, so restarts drop stale callbacks. Job-Object teardown unchanged.
  • Model (app/services/terminal_{model,session}): per-session ConPTY + bounded buffer + launch-generation guard; scoped new/select/close/switch + Clear/Interrupt(\x03)/Restart; closeAll() on workspace switch, shutdown() on exit.
  • Qt (terminal_{panel,view}, workbench_window): tabbed UI + shell selector + scoped actions; teardown wired into workspace switch and destructor.

Verified locally (MinGW, offscreen): model test 11/11, panel test 8/8, boundary script ✓.
Pending Windows CI (MSVC+Qt+Rust): workbench_window.cpp build, full CMake, real-ConPTY multi-session teardown.

…le, Qt panel

Implement issue #31 ([Windows][W3] 多会话终端系统), phase 4 of the Windows
development plan: turn the single hardcoded ConPTY session owned by
WorkbenchWindow into a multi-session terminal feature model that Qt renders.
The terminal stays off the rust/lithe-core JSON protocol (windows/-local),
per the application boundary contract.

Feature model + port (pure C++, no Qt/Win32 — verifiable off-Windows):
- adapters/ports.h: TerminalTransport gains setLifecycleHandler carrying the
  owning operationID, so a restart can drop stale callbacks (mirrors
  ProcessSession's lifecycle shape).
- adapters/win32_terminal_transport: emit Starting/Running/Failed/Finished
  through the existing once-only exit latch (exactly one terminal event per
  launch); Job-Object teardown (TerminateJobObject / KILL_ON_JOB_CLOSE) is
  unchanged, so a descendant cannot outlive a stop.
- app/services/terminal_{model,session}: session collection + current id + a
  terminal epoch (bumped on closeAll/shutdown to drop in-flight callbacks);
  each session owns its ConPTY transport + bounded TerminalBuffer + a launch
  generation guard; scoped new/select/close/switch and Clear/Interrupt (\x03)/
  Restart; closeAll() for workspace switch, shutdown() for app exit.

Qt UI (offscreen-tested):
- qt/terminal_{panel,view}: tab bar with new/close, shell selector, and a
  Clear/Interrupt/Restart toolbar; renders the bounded TerminalBuffer; marshals
  model callbacks onto the UI thread via queued connections.
- qt/workbench_window: owns a TerminalModel + TerminalPanel instead of a raw
  transport; openWorkspaceRoot closeAll()'s the prior workspace's sessions;
  destructor detaches the panel then shutdown()s the model (avoids touching a
  freed model from the panel dtor, since Qt child deletion runs after member
  destruction).

Tests + build:
- tests/fake_terminal_transport.h + terminal_model_test.cpp (11 cases, runs
  with plain g++; covers isolation, lifecycle, restart+stale-drop, duplicate
  stop, closeAll, bounded heavy output) and terminal_panel_test.cpp (8 cases,
  Qt offscreen; tabs, scoping, switch/close, restart).
- CMakeLists.txt: register terminal sources in lithe_windows_app (+ link
  lithe_windows_algorithms); add platform-independent
  lithe_windows_terminal_model_tests and offscreen
  lithe_windows_terminal_panel_tests; register Qt panel/view sources in
  lithe_windows_qt.

Verified locally: model test (11/11) and panel test (8/8) compile and pass;
scripts/verify-windows-boundaries.ps1 passes.
Still gated to Windows CI (MSVC+Qt+Rust): the workbench_window.cpp integration,
the full CMake build, and the real-ConPTY multi-session teardown test.
@milestone-17
milestone-17 requested a review from 1lck as a code owner August 10, 2026 05:58
@1lck 1lck closed this Aug 10, 2026
puppyben1 pushed a commit to puppyben1/Lithe-IDEA that referenced this pull request Oct 14, 2026
xiaoyumuxi added a commit that referenced this pull request Nov 14, 2026
* feat(desktop): 构建选项新增忽略路径,默认跳过所有以 . 开头的文件夹

PINNED_CORE_REVISION 升到 Lithe-core-rust#35 的合并提交 d19e9ef(其下是 #34)。
build.detect 按忽略路径剪掉文件夹:规则一行一条,写法同 .gitignore,相对项目根目录,
只匹配文件夹;默认是 ".*",.claude/worktrees 这类以 . 开头的文件夹不再被当成构建根。

- core:BuildDetectOptions.ignoredPaths、resolveStoredOptions 返回的 ignoredPaths
  (patterns + source local/team/default),新增 EditBuildIgnoredPaths 绑定
  build.editIgnoredPaths。
- 构建选项对话框顶部新增“检测”分区:忽略路径多行输入、ⓘ 说明、当前来源说明
  (本机 / 团队文件 .lithe/build/options.json / 默认),本机列表可“恢复默认”。
  修改只写本机文档,保存后重新检测;Core 拒绝的规则按行号报错,对话框保持打开。
- Build 窗口标题栏新增齿轮,打开只含忽略路径的构建选项;构建系统行的齿轮和
  右键菜单仍打开该构建系统的选项,并在上方显示忽略路径。中文里该按钮改叫“选项”,
  与标题栏的“构建选项”区分。
- 新增 i18n 词条与功能矩阵说明;测试覆盖保存/恢复默认/行号报错和 Core 绑定。

* fix(desktop): 打开构建选项时在后台读取本机和团队文档

对话框打开和“恢复默认”时读取 .lithe/build/options.json 与本机构建选项文档,
改为和 Core 调用一起在后台执行,窗口线程只发布结果。
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.

2 participants