Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions desktop/internal/localshell/integration_windows_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,13 @@ func TestWindowsShellReportsDirectoryAfterChangingIt(t *testing.T) {
screen.SetPromptToken("test-token")
started := false
screen.SetPromptStart(func() { started = true })
wait := func(want string) {
// The first prompt waits for the shell to start. Windows PowerShell 5.1 takes about 9 s
// to start on the Windows CI runners and sometimes more than 12 s; the prompt after a
// directory change comes much sooner.
const startDeadline, promptDeadline = 45 * time.Second, 12 * time.Second
wait := func(want string, limit time.Duration) {
t.Helper()
deadline := time.NewTimer(12 * time.Second)
deadline := time.NewTimer(limit)
defer deadline.Stop()
for {
screen.Write(shell.Drain(nil))
Expand All @@ -54,15 +58,15 @@ func TestWindowsShellReportsDirectoryAfterChangingIt(t *testing.T) {
}
}
}
wait(home)
wait(home, startDeadline)
command := "Set-Location -LiteralPath '" + strings.ReplaceAll(target, "'", "''") + "'\r"
if strings.EqualFold(filepath.Base(program), "cmd.exe") {
command = "cd /d \"" + target + "\"\r"
}
if !shell.Write([]byte(command)) {
t.Fatal("shell refused input")
}
wait(target)
wait(target, promptDeadline)
})
}
}
Expand Down
11 changes: 9 additions & 2 deletions desktop/internal/workbench/workbench_background_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,21 @@ func (h *harness) veilAlpha() float32 {

func near(a, b float32) bool { return math.Abs(float64(a-b)) < 0.002 }

// windowControlsLayer is the layer of the minimize, maximize and close buttons Viva draws in the
// custom title bar on Windows and Linux: above every layer an application uses, and declared
// last. They are not workbench controls.
const windowControlsLayer = math.MaxUint16

// frontLabeled is where the front-most control named label was laid out in the last frame:
// a popover's buttons are declared after the workbench under it, whose controls may share
// their names.
// their names. The title bar's window buttons are skipped. On Windows and Linux they are
// declared after the popover, and the window's close button has the same name as the
// popover's (关闭), so taking it instead would click the window's close button.
func (h *harness) frontLabeled(label string) gfx.Rect {
h.t.Helper()
hits := h.driver.Snapshot().Hits
for i := len(hits) - 1; i >= 0; i-- {
if hit := hits[i]; hit.Label == label && !hit.IsLabel && !hit.Backdrop {
if hit := hits[i]; hit.Label == label && !hit.IsLabel && !hit.Backdrop && hit.Layer != windowControlsLayer {
return hit.Bounds
}
}
Expand Down
16 changes: 8 additions & 8 deletions scripts/desktop/build-desktop-core.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ native_path() {
}

PINNED_CORE_REPOSITORY="https://github.com/Lithe-IDEA/Lithe-core-rust.git"
# The head of Lithe-core-rust #30, not yet merged, stacked on #28, not yet merged either; replace
# it with the merge commit once both are in main. #30 adds the host rules the desktop no longer
# keeps itself (processLifecycle gracefulStopRule, network.proxyPolicy exclusionRules,
# Lithe-core-rust #31, squash-merged into main. It re-lands #30, which was merged into the branch
# of #28 after #28 itself had gone into main, and adds the host rules the desktop no longer keeps
# itself (processLifecycle gracefulStopRule, network.proxyPolicy exclusionRules,
# git.changedFileGroups, git.worktrees states and git.worktreeCreationPreview,
# plugins.installed.lifecycle, editor.groupLayout.*, workspace.rowSelection.reduce and
# workspace.projectTree.rows) in four new rule crates (50 in the workspace). #28 splits 34
# more crates out of lithe-core (46 in the workspace); command names, JSON, error codes and the
# C header are unchanged, except that a build system's
# source:"hostIntegration" is now refused as plugin.manifest.invalid. It is on top of #29 (cold
# workspace.projectTree.rows) in four new rule crates (50 in the workspace). It is on top of #28
# (34 more crates split out of lithe-core, 46 in the workspace; command names, JSON, error codes
# and the C header unchanged, except that a build system's source:"hostIntegration" is now
# refused as plugin.manifest.invalid), squash-merged into main, on top of #29 (cold
# managed runtimes may finish LSP initialization), squash-merged into main, on top of
# #27 (protocol, network, terminal, process, diff and github split into their own
# crates, keymap and action search moved into lithe-core-rules; command names, JSON, error codes
Expand All @@ -56,7 +56,7 @@ PINNED_CORE_REPOSITORY="https://github.com/Lithe-IDEA/Lithe-core-rust.git"
# the contract, plugin guides, reference and SDKs live only in shared/plugins; on top of #16 (reported Git queries folded in the console),
# #15 (git.write cherryPick, revert and reset fields), #14 (word-level changed ranges of diff
# rows), #13, #8, #7, #6 and #4.
PINNED_CORE_REVISION="5efe90b4c6adfb831c13c38059aab0c77c5b5263"
PINNED_CORE_REVISION="62b8a08fe41cd3d67f0f32d72653392410e6aa37"
PROFILE="debug"
while [[ $# -gt 0 ]]; do
case "$1" in
Expand Down
5 changes: 3 additions & 2 deletions shared/platform-feature-matrix/features/terminal-shell.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@
"desktop/internal/localshell/discovery.go",
"desktop/internal/settingswindow/terminal_view.go",
"desktop/internal/workbench/terminal_env.go",
"desktop/internal/workbench/terminals.go"
"desktop/internal/workbench/terminals.go",
"desktop/internal/localshell/integration_windows_test.go"
]
},
"owner": "Terminal",
"verification": "验证设置页默认 Shell 选项与终端「新建终端」菜单检测到的 Shell 一致、可选 Git Bash 并生效;macOS 新建终端下拉框复用 Project 下拉框的共享菜单样式,菜单操作与原有 Shell 选择、重新检测功能一致;验证环境变量、工作目录和不可用 Shell 的提示。 设置页终端分组新增回滚行数配置(默认 2000,范围 100–50000,步进 500),读取、写入、恢复默认均做上下限夹取,对新建会话生效(TerminalScrollbackSettingsTests);设置搜索按界面名称 Terminal scrollback/终端回滚行数/行数 均可命中终端页(SettingsSearchVocabularyTests)。 macOS 终端环境随 TERM_PROGRAM=Lithe 一并导出 TERM_PROGRAM_VERSION(取应用打包版本,无法取得时不写入),与 Windows 端一致,供工具按版本门控终端能力(TerminalModuleTests);按当前外观导出 COLORFGBG(浅色 0;15、深色 15;0,宿主无法判定时不写入),TUI 无需 OSC 查询即可选择配色(TerminalModuleTests)。终端会话在启动前剥离从宿主进程继承的 NO_COLOR、FORCE_COLOR、CLICOLOR_FORCE、CI、GITHUB_ACTIONS 和 CONTINUOUS_INTEGRATION,并设置 CLICOLOR=1;显式 environmentChanges 仍可覆盖,避免 Codex 和 Claude Code 因父进程环境退化为黑白。",
"verification": "验证设置页默认 Shell 选项与终端「新建终端」菜单检测到的 Shell 一致、可选 Git Bash 并生效;macOS 新建终端下拉框复用 Project 下拉框的共享菜单样式,菜单操作与原有 Shell 选择、重新检测功能一致;验证环境变量、工作目录和不可用 Shell 的提示。 设置页终端分组新增回滚行数配置(默认 2000,范围 100–50000,步进 500),读取、写入、恢复默认均做上下限夹取,对新建会话生效(TerminalScrollbackSettingsTests);设置搜索按界面名称 Terminal scrollback/终端回滚行数/行数 均可命中终端页(SettingsSearchVocabularyTests)。 macOS 终端环境随 TERM_PROGRAM=Lithe 一并导出 TERM_PROGRAM_VERSION(取应用打包版本,无法取得时不写入),与 Windows 端一致,供工具按版本门控终端能力(TerminalModuleTests);按当前外观导出 COLORFGBG(浅色 0;15、深色 15;0,宿主无法判定时不写入),TUI 无需 OSC 查询即可选择配色(TerminalModuleTests)。终端会话在启动前剥离从宿主进程继承的 NO_COLOR、FORCE_COLOR、CLICOLOR_FORCE、CI、GITHUB_ACTIONS 和 CONTINUOUS_INTEGRATION,并设置 CLICOLOR=1;显式 environmentChanges 仍可覆盖,避免 Codex 和 Claude Code 因父进程环境退化为黑白。 Windows 运行 TestWindowsShellReportsDirectoryAfterChangingIt:cmd.exe、powershell.exe、pwsh.exe 各自启动后报告起始目录,进入含中文、空格、分号和百分号的目录后报告新目录;等第一个提示符的期限是 45 秒(Windows PowerShell 5.1 在 CI 上冷启动约 9 秒,偶尔超过 12 秒),进入目录后的提示符仍是 12 秒。",
"legacy": {
"revision": "5a54c41aa37a4e6e6b68918a4b05765b9dd07a36",
"macos": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
]
},
"owner": "Workbench",
"verification": "在 macOS 与 Windows 的浅色、深色主题下分别验证:未选图片时,侧边按钮条背景弹窗和 设置 → 外观 都显示“未选择背景图片”和“选择图片…”,不显示图片可见度与移除;从弹窗选择 PNG 或 JPEG 后,打开的项目窗口整窗显示按比例裁切居中的图片,欢迎页不显示;设置页缩略图与工作台裁切一致,在设置页切换淡、中、浓,工作台遮罩随之变化,弹窗显示同一档位;项目树、编辑区、终端、Git 日志、差异与 Markdown 预览透出图片且文字可读,菜单、弹窗、通知与输入框保持实底;多个项目标签共用同一背景;移动或删除原图片后重启,背景仍在;选择损坏或超大的图片时显示原因且原背景不变;移除后恢复主题底色、数据目录中的副本被删除;整个流程中应用包或安装目录的文件清单与哈希不变。",
"verification": "在 macOS 与 Windows 的浅色、深色主题下分别验证:未选图片时,侧边按钮条背景弹窗和 设置 → 外观 都显示“未选择背景图片”和“选择图片…”,不显示图片可见度与移除;从弹窗选择 PNG 或 JPEG 后,打开的项目窗口整窗显示按比例裁切居中的图片,欢迎页不显示;设置页缩略图与工作台裁切一致,在设置页切换淡、中、浓,工作台遮罩随之变化,弹窗显示同一档位;项目树、编辑区、终端、Git 日志、差异与 Markdown 预览透出图片且文字可读,菜单、弹窗、通知与输入框保持实底;多个项目标签共用同一背景;移动或删除原图片后重启,背景仍在;选择损坏或超大的图片时显示原因且原背景不变;移除后恢复主题底色、数据目录中的副本被删除;整个流程中应用包或安装目录的文件清单与哈希不变。 运行 TestStripeBackgroundButtonOpensThePopoverThatChoosesTheImage,确认侧边按钮条的背景按钮打开弹窗、弹窗的关闭按钮能关掉弹窗。Windows 和 Linux 上 Viva 在最上层(math.MaxUint16)自绘窗口的最小化、最大化和关闭按钮,窗口关闭按钮和弹窗关闭按钮都叫“关闭”,测试按名字找弹窗按钮时跳过这一层,不能点到窗口的关闭按钮;该回归在 Linux 和 Windows 的 CI 上执行,macOS 用系统红绿灯,没有这一层。",
"notes": "Viva:两端共用 desktop/ 实现。所选文件经 store.WriteFile 复制到用户数据目录,设置只保存原文件名与档位;读取、校验、解码图片以及写入、删除副本都在窗口线程外进行,图片一次缩到最长边 2560 像素以内;新图片的副本写好后才替换当前背景,写入失败时保留原背景并提示。图片作为窗口 0 层整窗绘制,其上按档位叠主题底色遮罩(淡 0.92、中 0.80、浓 0.62),面板、外框、编辑区和终端不再画实底。只在打开项目时显示。图片可见度在没有图片时不显示。"
}
Loading