mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-11-23 16:42:19 +00:00
4db44e2ede1996cd52f48c422fd78a34322f0d13
87
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
57089a3abf |
feat: temporary network device mode and tab-bar quick connect (#3793)
* feat(ssh): opt temporary connections into network device mode Saved hosts and group-backed clones keep their own device type. SSH connections with no saved host, including external launches and quick connect, can start in network device mode when the new Terminal setting is on. The setting stays off unless the user turns it on. Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com> * feat(terminal): quick connect typed addresses from the tab switcher The tab-bar quick switcher now offers the typed address when it already parses as a connection target. Choosing that row opens the existing quick connect wizard, including from a terminal tab where the vault surface is hidden. Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com> * fix(ssh): keep temporary Mosh and ET off network device mode Those transports are stored as SSH plus a flag. Stamping network device mode onto them made raw-host checks skip the copy-session working directory probe. Plain temporary SSH still opts in. Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com> * fix(ssh): read temporary connection settings at connect time VaultView keeps a stale onConnect callback because its memo ignores that prop. Read both temporary-connection toggles from a ref when connecting so turning them on or off applies in the same session. Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com> * fix(terminal): stop word queries from opening quick connect Show the switcher quick-connect row only for address-like input, and place it after matching hosts so Enter still connects to a saved host. Translate the Hosts, Tabs, and New Workspace labels. Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com> * fix(terminal): keep matching tabs ahead of quick connect An address that matches an open session or workspace was still the default Enter target when no saved host matched. Put that row after those tabs so Enter switches to the existing one. Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com> |
||
|
|
a01563931b |
feat(ssh): opt in legacy algorithms for temporary connections (#3792)
Saved hosts keep their own setting. External launches and quick connect with no saved host can use the same legacy algorithm list when the new global setting is turned on. It stays off by default. Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com> |
||
|
|
00c4095e59 |
feat: global default proxy with explicit direct override (#3774)
* feat: add a global default proxy with an explicit direct override Resolve the proxy as the host setting, then the nearest group default, then one optional saved profile from synced settings, then a direct connection. A host can choose direct and skip both inherited defaults. Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com> * fix: keep global default proxy persistence across settings instances Unregister only the setter owned by the unmounting useSettingsState instance so closing Settings still writes the cleared default through the remaining AppLockGate setter. Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com> * fix: round-trip explicit direct mode in vault CSV Write the Proxy cell as direct when a host sets directProxy, and import that literal back as an explicit direct connection. An empty Proxy cell still inherits. Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com> * fix: keep CSV proxy export from embedding the global default Grouped hosts ran through applyGroupDefaults and picked up the ambient global proxy, while ungrouped hosts exported an empty inheriting cell. Both paths now opt out of that default so inheritance stays inheritance. Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com> * fix: follow global default proxy changes in peer session windows Session windows disable settings IPC sync, which also skipped the storage listener and left the resolver singleton at its mount-time id. Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com> * refactor: clear a deleted global default proxy at the call site Drop the pass-through field on removeProxyProfileReferences. The profile manager already knows the active id and clears it directly. Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com> * test: share the global default proxy settings harness The peer-window case and the multi-instance cleanup case were mounting the same JSDOM fixture twice. Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: 陈大猫 <binaricat@users.noreply.github.com> |
||
|
|
bd8476fb34 |
fix(terminal): enable font ligatures from the terminal setting (#3557)
fontLigatures already defaulted to on, but the terminal never loaded the ligatures addon, so Fira Code and Maple Mono kept drawing != as two cells. Activate the addon after open and before WebGL, and rebuild the WebGL atlas when the setting changes so glyphs are not rasterized without the calt feature. The addon bundles lru-cache's node:diagnostics_channel import. Alias that builtin to a no-op channel in the Vite renderer build and in the Electron live-test bundles. Closes #3543 |
||
|
|
6ece7e8222 |
feat(terminal): Add configurable terminal bar cursor width (#3495)
* feat(terminal): Add configurable terminal bar cursor width Adds a configurable bar-cursor width for the terminal so thin vertical cursors are easier to find, particularly when vi/vim switches to insert mode. * Add terminal bar cursor width setting This adds the terminal bar cursor width control to the settings UI with an aria-label for accessibility and a matching test. It also adds localized labels/descriptions and search catalog entries so the setting is discoverable in both English and Chinese. * Fix terminal cursor width override bug Prevent width-only cursor updates from clearing DEC/vi cursor overrides by tracking the last applied shape/blink snapshot. The runtime now resets the snapshot on teardown, skips full cursor reapplication for width-only changes, and preserves remote bar/underline cursor styles. Added regression tests covering boot-time and later width updates. * Fix terminal cursor preference lifecycle Preserve DEC/vi cursor overrides during the first width-only terminal update after runtime creation. The runtime now records the user cursor preference snapshot when a term is published and applies width-only updates without clearing active cursor style or blink overrides. This prevents regressions when terminal settings change before the panel has fully booted. --------- Co-authored-by: bincxz <16399091+binaricat@users.noreply.github.com> |
||
|
|
12a3ae07ef |
feat: Enable SFTP sidebar and button for local shell sessions (#3379)
* Add local shell side panel auto-open settings with i18n support - Add settings to control side panel behavior for local shell sessions - Support auto-opening side panel when local shell is launched - Allow users to choose which pane (Files, SFTP, Scripts, etc.) opens by default - Add complete i18n translations for en, zh-CN, zh-TW, es, ru locales * fix: wire local shell side panel settings * fix: restore undefined check for local shell protocol detection Local shell sessions may have protocol=undefined, not just 'local'. Restore the original condition to auto-open sidebar for both cases. * fix: enable SFTP sidebar for local shell sessions Local shell now supports SFTP (for local file browsing). Update sftpAvailable to include local shell so the auto-open sidebar setting works correctly for PowerShell/bash sessions. * chore: bump version to 1.1.83-fork.1 Distinguish fork from upstream (1.1.83) and previous 0.0.0 dev version. * feat: show SFTP button in local shell toolbar Local shell sessions now display the 'Open SFTP' button in the toolbar, allowing users to browse local files via SFTP sidebar, consistent with the auto-open behavior added earlier. * feat: 本地Shell侧边栏支持追随终端目录功能 - 追随终端目录现在支持本地 POSIX shell(bash/zsh/fish) - 排除 PowerShell 和 cmd(因为它们的 cd 命令和路径格式不同) - 串口连接仍然不支持(它们根本没有 SFTP) - 定位路径到终端功能已支持本地 Shell(无需修改) * feat: support PowerShell and CMD in session restore - Accept Windows absolute paths (C:\...) in isRestoreCwdPathEligible - Add shell-specific cd commands: * PowerShell: Set-Location -LiteralPath with '' quote escaping * CMD: cd /d with "" quote escaping * bash/POSIX: cd -- with '\'' quote escaping - Remove PowerShell/CMD restrictions in cwd injection eligibility - Fix line terminator in SFTP locate path (use \r\n for Windows PTY) * fix: bound local shell panel preferences and synchronize settings --------- Co-authored-by: HHXXYY123 <HHXXYY123@outlook.com> Co-authored-by: binaricat <binaricat@users.noreply.github.com> Co-authored-by: bincxz <16399091+binaricat@users.noreply.github.com> |
||
|
|
b1a0a26d01 |
feat(settings): 设置全局搜索(可展开联想跳转) (#2816)
Closes #2616 Closes #2683 Add expandable settings search with autocomplete jump-to-anchor navigation across tabs (including AI/Sync sub-tabs). |
||
|
|
857429f6dc |
fix(terminal): show server name in host info bar (#2732)
* fix(#2708): automated Cursor CLI fix * fix(terminal): let host info bar show label or address Avoid concatenating both into the toolbar; add a setting so users pick vault label or connection address, with the other kept in the tooltip. Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: netcatty-bot <308658023+netcatty-bot@users.noreply.github.com> Co-authored-by: bincxz <16399091+binaricat@users.noreply.github.com> Co-authored-by: Cursor <cursoragent@cursor.com> |
||
|
|
c74cbd4874 | fix(#2639): automated Cursor CLI fix | ||
|
|
906be8afbf |
Merge pull request #2597 from binaricat/cursor/issue-2595-30440878230
feat(terminal): add autocomplete history suggestion scope setting |
||
|
|
1fefb7b1d7 | fix(#2595): automated Cursor CLI fix | ||
|
|
515bf7be7f | feat(settings): refine font preview and virtualize host lists | ||
|
|
2e9491a86f | fix(settings): scope font picker focus behavior | ||
|
|
fc7287e328 |
feat(terminal): render Kitty/SIXEL/iTerm inline images
Load @xterm/addon-image in the shared xterm runtime so remote programs can draw real raster images (kitten icat, chafa --format kitty, image previews in file managers and TUIs) instead of ANSI approximations. - domain/terminalInlineImages.ts owns the limits and turns TerminalSettings into addon options; disabled settings resolve to null so the addon is not loaded at all and the terminal keeps advertising no graphics capability. - The addon is loaded right after term.open, before the WebGL renderer, so it patches IRenderService.setRenderer first and its canvas layers survive every DOM <-> WebGL swap (deferred WebGL, soft-hide suspend, context-loss rebuild). It is disposed before term.dispose so bitmaps never outlive their terminal. - Hibernate restores a tab from a text-only snapshot, which cannot carry image data. XTermRuntime.hasInlineImages reads the live image cache, and Terminal degrades such a session to soft-hide: hibernateRuntime takes the soft-hide branch, canFinishHibernate re-checks after every async step, and an eviction request leaves the session soft-hidden. The block lifts by itself once the cache is emptied by a terminal reset or FIFO eviction. - Settings > Terminal > Inline Images exposes the master switch, per-protocol switches (Kitty / SIXEL / iTerm IIP) and the memory limits, translated for en, zh-CN, zh-TW and ru. Protocol switches cloud-sync; the memory limits stay local like the other per-device renderer tuning. Co-authored-by: Wine Fox <fox@ling.plus> |
||
|
|
bdfb6a04fa |
fix(terminal): disable incomplete Kitty keyboard negotiation by default (#2382)
* fix(terminal): disable incomplete Kitty keyboard negotiation by default * fix(terminal): present Kitty keyboard setting normally --------- Co-authored-by: Bowen <878882730@qq.com> Co-authored-by: bincxz <16399091+binaricat@users.noreply.github.com> |
||
|
|
3c393380e5 |
feat(settings): support local CJK fonts (#2267)
* feat(settings): support local CJK fonts * refactor: move CJK font rules to domain * fix(settings): improve CJK font preview safety * fix(settings): refresh local font previews * fix(settings): improve font picker keyboard behavior * fix(settings): handle unavailable font detection * fix(settings): cover font picker edge cases * fix(settings): quote custom font families safely |
||
|
|
18b2f435bc |
feat(terminal): configurable su/sudo password prompt assist (#2156) (#2176)
* feat(terminal): configurable su/sudo password prompt assist (#2156) Extend the existing confirm-to-fill sudo assist to arm on su as well, and add a Terminal setting for off / quick Enter fill / WindTerm-like credential picker. Picker candidates come from the host password plus keychain password identities; secrets are never shown in the list or sent without confirmation. * fix(terminal): tighten password prompt assist after codex review - Hint mode only uses the session host password, never an arbitrary keychain identity as a silent Enter target. - Build autofill candidates from the effective session host so group- inherited passwords participate. - Clear a stale credential picker when the session disconnects. * fix(terminal): more password-assist polish from codex review - Do not swallow arrow keys while the quick-fill hint is pending; only the multi-credential picker consumes them. - Clear the picker overlay on hibernate and wake so it cannot outlive the autofill controller. - Show the resolved auth username on the host candidate row (identityId / group identity), not a stale host.username after password dedupe. * fix(terminal): keep password picker select callback stable Avoid forcing TerminalView memo invalidation on every Terminal render by using a stable useCallback for credential selection. * fix(terminal): do not offer full keychain on unarmed sudo prompts Picker mode only lists all password identities after a real su/sudo command was armed. Unarmed explicit [sudo] lines still get host-password quick-fill only, blocking remote prompt phishing of other credentials. * fix(terminal): fix picker mode switch and armed picker test Arm before inspecting the picker payload, and when switching settings mid-prompt recompute whether the command arm is still valid so picker mode can open the full list. * fix(terminal): reopen password picker after a wrong credential Keep the su/sudo arm active after confirm-to-fill so a rejected password re-prompt can offer the full credential list again instead of falling back to host-only unarmed assist. * fix(terminal): only re-assist real auth retries after fill Keep a short post-fill arm for wrong-password re-prompts, but require an explicit [sudo] line or authentication-failure text before reopening assist. Prevents sending the host password into child prompts after a successful sudo (e.g. sudo mysql -p). * fix(terminal): scope sudo assist away from child password prompts Track whether the armed command was sudo or su. su still accepts bare Password: lines; sudo only assists on [sudo] tags or user-scoped prompts (password for … / 输入密码), not generic Enter password when sudo is cached. * fix(terminal): tighten when the full credential picker may open Exclude child-program prompts (Enter password, Password for user …). Full keychain picker only for explicit [sudo] lines or armed su Password: prompts; Kylin-style sudo bare prompts still get host-password hint only. * fix(terminal): limit full credential picker to armed su only Multi-identity picker is the WindTerm-style su workflow (#2156). Sudo keeps host-password quick-fill only, so a cached sudo child cannot open the full keychain list via a forged or nested password prompt. * fix(terminal): derive password assist candidates in Terminal + mode gate - Standalone Terminal popups without TerminalLayer now resolve candidates from host/keys/identities so su picker mode still works. - When switching to picker mid-prompt, keep the su-only full-list gate (do not open multi-identity list for an armed sudo prompt). * fix(terminal): reject SSH-style prompts for su assist and drop dupe keys - su bare matching only accepts short Password:/密码 lines, not user@host SSH password prompts after passwordless su -c. - Remove duplicate sudoAutofillCandidates keys that failed eslint. * fix(terminal): cursor-anchor password picker and soft-dismiss Esc Position the su credential picker with the same cursor-relative layout helpers as autocomplete instead of fixed bottom-center. Esc only closes the UI while keeping the arm so Esc/arrows can reopen the list on the same Password: prompt. |
||
|
|
1520040b6e |
Add option to hide terminal host information bar (#2125)
* Add option to hide terminal host info bar * Preserve terminal actions and sync preference * Make hidden terminal actions accessible * Fix compact terminal action toggle * Keep compact action menus accessible * Preserve focus for compact terminal actions |
||
|
|
6e3401f9dc |
[codex] Add SSH auto reconnect (#1931)
* Add SSH auto reconnect * Fix auto reconnect for hibernated sessions |
||
|
|
05231d3fba | Add terminal side panel auto-open setting | ||
|
|
1c5723ddc7 | Preserve manual terminal theme defaults | ||
|
|
7d321a4f03 | Hide terminal theme preview when following app theme | ||
|
|
0e80c874d6 | Clarify terminal theme follow behavior | ||
|
|
7a62acb828 | Add tray host key trust prompt | ||
|
|
033b904982 |
fix(terminal): platform-aware default font + remeasure on webfont load (#1647)
Fix #1647: on Windows/Linux the macOS-only `menlo` default left terminal ASCII garbled on cold start until a manual resize, because the primary glyphs fell through to a bundled `font-display: swap` webfont (JetBrains Mono) that swapped in after xterm measured the cell grid. - Store the terminal font default as a platform-neutral `auto` sentinel, resolved to a locally-installed font per OS at render (win32→consolas, linux→dejavu-sans-mono, darwin→menlo). Safe to persist/sync; never leaks one OS's font to another. - Explicitly preload the bundled webfonts the terminal actually renders with and remeasure on every `document.fonts` `loadingdone`, so any late webfont swap (incl. user-chosen) recovers without a manual resize. Reviewed by local Codex (3 adversarial passes); findings on default persistence/sync and side-panel no-op writes addressed. 🤖 Generated with [Claude Code](https://claude.com/claude-code) |
||
|
|
bf723e7348 | fix: remove terminal background mirror | ||
|
|
53328ca50d |
feat(terminal): optimize hibernate wake for large buffers
Add chunked replay, deferred WebGL during restore, alt-screen hibernate policies, soft-hide LRU, two-phase viewport/scrollback snapshots, and a main-process headless xterm mirror for faster wake serialization. Co-authored-by: Cursor <cursoragent@cursor.com> |
||
|
|
12a513606b |
feat(terminal): hibernate hidden tabs to reduce renderer memory
Dispose xterm for off-screen tabs while keeping SSH connected, with configurable delay, file-transfer exemptions, and wake replay for alternate-screen apps. Co-authored-by: Cursor <cursoragent@cursor.com> |
||
|
|
cff74b6e49 | polish terminal and settings UI | ||
|
|
94464da004 |
[codex] Fix follow-app terminal theme selection (#1562)
* Fix follow-app terminal theme selection * Fix custom follow theme selection |
||
|
|
6ef0a4ad6b | Fix settings localization gaps (#1465) | ||
|
|
1ebcd017bd | Make terminal timestamps per-host | ||
|
|
36267717ac |
feat(terminal): add system manager side panel for processes, tmux, and Docker
Introduce workspace-aware System side panel with remote process/tmux/Docker management, terminal popup for interactive attach, capability warmup, review-hardened IPC, performance optimizations, toast action errors, and SSH channel recovery on reconnect. |
||
|
|
733e19a6f6 |
perf(settings): reduce Mac settings window input lag (#1347) (#1368)
* perf(settings): reduce Mac settings window input lag (#1347) Debounce custom CSS commits, memoize heavy tabs, and replace Radix ScrollArea with native scrolling so typing and navigation stay responsive on macOS. Co-authored-by: Cursor <cursoragent@cursor.com> * fix(settings): flush debounced textarea on unmount Avoid losing custom CSS edits when the settings window closes before the debounce timer fires. Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Cursor <cursoragent@cursor.com> |
||
|
|
3ef5a64b94 |
feat(settings): unify settings page card and section layout (#1316) (#1319)
Introduce shared SettingCard and SettingsSection primitives so AI, SFTP, system, and terminal tabs use the same white-card + row control pattern. Co-authored-by: Cursor <cursoragent@cursor.com> |
||
|
|
e9e8c35178 | Add terminal and log timestamps | ||
|
|
008890a688 |
feat(terminal): 自定义本地 Shell 支持启动参数 (#1221) (#1225)
* feat(terminal): 支持为自定义本地 Shell 配置启动参数 (#1221) 自定义本地 Shell 此前只能填可执行文件路径,无法指定启动参数, 导致接入 msys2 bash 时缺少 `--login -i`,shell 不经 profile 初始化、 环境变量缺失而无法使用。 - TerminalSettings 新增 localShellArgs(string[],默认 []),随设置自动迁移 - 新增 domain/shellArgs:引号感知的命令行分词/回显格式化 - resolveShellSetting 透传自定义参数;参数为空时回退到 bridge 默认参数, 命中已发现 shell(WSL/Git Bash)时忽略自定义参数,避免串味 - 自定义 Shell 弹窗新增「启动参数」输入,设置行展示完整命令(en/zh-CN/ru) 参数复用已有管线 session.localShellArgs → startLocalSession → pty.spawn, 不涉及云同步(与机器相关的 localShell 一致,均不同步)。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * fix(terminal): 修复自定义 Shell 参数的两处 review 问题 - 切换到默认/已发现 shell 时清空 localShellArgs:自定义参数仅对自定义 路径有意义,清空可避免在发现列表尚未加载(启动竞态)或所选 shell ID 在本机不可用时,旧参数被当作该 shell 的启动参数而泄漏导致启动失败 - formatShellArgs 对含双引号的参数改用单引号包裹,修复 `-c "..."` 这类参数重新打开弹窗保存时被破坏的往返问题 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * fix(terminal): shellArgs 量化处理含两种引号的参数往返 采用单引号优先的引号策略:单引号内全字面(Windows 路径、双引号原样保留, 无需转义);仅当 token 自身含单引号时改用双引号包裹并转义 \ 与 "。 解析端仅在双引号区内将 \" / \\ 视为转义,其余反斜杠保持字面, 确保未加引号的 Windows 路径不被破坏。修复 `echo "it's ok"` 这类同时含 单双引号的参数在弹窗重新保存时被破坏的问题。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * fix(terminal): 自定义 Shell 已选中后可重新打开编辑参数 自定义 shell 选中时下拉框值已是 __custom__,再次点选「自定义…」不会触发 onValueChange,导致无法重新打开弹窗修改参数/路径。改为把自定义 shell 概要 做成可点击的编辑入口(铅笔图标),点击即重新填充草稿并打开弹窗; 打开逻辑抽到 openCustomShellModal 复用。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * fix(terminal): shellArgs 改用 POSIX 单引号方案,修复尾部反斜杠与空参数 - 解析:两种引号区内均全字面(双引号不再把 \" 当转义),保留 Windows 路径尾部反斜杠等手输入;引号外仅 \' 转义为字面单引号(支撑 '\'' 习语), 其余反斜杠保持字面,未加引号的 Windows 路径不受影响 - 格式化:统一单引号包裹(内容全字面),内嵌单引号用 POSIX '\'' 习语; 显式空参数输出为 '' 以免重新保存时被丢弃 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * fix(terminal): customArgs take precedence over discovered shell defaults when user explicitly sets them --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com> |
||
|
|
1fec5925eb | Refactor large modules and fix runtime errors (#1136) | ||
|
|
67448cea65 |
feat(terminal): configurable startup-command delay + multi-line sequencing (#1096)
* feat(terminal): add global startupCommandDelayMs setting Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * feat(terminal): add startup-command line-split and delay-clamp helpers Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * feat(terminal): run multi-line startup commands in sequence with configurable delay Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * feat(terminal): expose startup command delay in Terminal settings Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * refactor(terminal): keep startup-command line content verbatim splitStartupCommandLines now only drops blank/whitespace-only lines and normalizes CRLF, but no longer trims each line's content. This keeps a single-line startup command byte-identical to what the user typed (e.g. a leading space for HISTCONTROL=ignorespace is preserved), while still supporting multi-line sequencing. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(sync): include startupCommandDelayMs in synced terminal settings Terminal settings sync via the SYNCABLE_TERMINAL_KEYS allowlist; the new startupCommandDelayMs preference was missing, so it wouldn't propagate across devices. Add it (it's a user preference like keepaliveInterval, not device-specific). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> |
||
|
|
1d50b2c4a1 |
feat(terminal): choose dark/light terminal theme when following app theme (#1094)
* feat(terminal): add per-mode follow-theme resolver and storage keys Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * feat(terminal): persist per-mode follow-theme selections in settings state Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * feat(sync): include per-mode follow terminal themes in cloud sync Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * i18n(terminal): add per-mode follow-theme picker strings * feat(terminal): add type filter and auto option to theme picker * feat(terminal): pick dark/light terminal theme when following app theme Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix(terminal): don't flag the auto sentinel as a missing theme in the picker The per-mode follow-theme pickers default to the 'auto' sentinel, which is not a real theme id, so ThemeList's deletedSelectedTheme check classified it as a deleted custom theme and rendered a spurious "Missing Theme" banner above the Auto entry on first open. Exclude TERMINAL_THEME_AUTO from that check. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * i18n(terminal): align zh-CN dark/light wording with app convention Use 深色/浅色 (matching the theme picker section headers and global appearance settings) instead of 暗色/亮色 for the per-mode terminal theme labels, so the picker modal reads consistently. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(terminal): match follow-theme preview fallback to runtime resolution The per-mode preview memos fell back straight to TERMINAL_THEMES[0] when a selection resolved to a deleted theme, while the runtime currentTerminalTheme memo falls back to the manual terminalThemeId first. Mirror the runtime chain so the Settings preview matches the actual terminal for users with a non-default manual theme. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> |
||
|
|
bf1c95500a |
feat #826: optional Option+←/→ word jump on macOS (#1082)
* feat #826: optional Option+←/→ word jump on macOS Adds a Terminal → Keyboard toggle "Option+←/→ jumps by word" (off by default, synced). When on, a bare Option+Left/Right sends Meta-b / Meta-f instead of xterm's default ^[[1;3D / ^[[1;3C, so readline/zle moves by word without per-host bindkey setup (Termius-style). The key→sequence mapping is a tested pure function; the handler reads the setting live (no reconnect) and runs after kitty mode + autocomplete so it doesn't override them. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix #826: gate Option+←/→ word jump to macOS The setting is syncable, so without a platform gate, enabling it on a Mac would also rewrite Alt+←/→ to Meta-b/f on synced Linux/Windows devices, breaking apps/shells that expect the default ^[[1;3D / ^[[1;3C. Pass isMacPlatform() into the mapping so it only applies on macOS; add a test for the non-macOS case. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|
|
3e8965f9a9 | Fix pr987 (#1010) | ||
|
|
88732040aa |
fix(terminal): separate prompt after unterminated command output (#987)
* fix(terminal): separate prompt after unterminated command output Add a display-layer prompt line break handler so recognized shell prompts move to the next visual line when the final command output line is not newline terminated. Also add a terminal setting to toggle the behavior, sync support, i18n copy, and focused tests for prompt insertion. * fix review issue * Fix prompt cache initialization * Serialize terminal output writes for prompt breaks * Keep terminal status lines ordered with output * Fix prompt arming without command callback * Keep prompt display breaks out of session logs * Avoid prompt breaks for output suffix matches --------- Co-authored-by: yuzifu <yuzifu@TB16PGen5.Info> Co-authored-by: bincxz <16399091+binaricat@users.noreply.github.com> |
||
|
|
67c5571df5 |
Fix #958: highlight IPv6 + allow editing built-in keyword rules (#962)
Two changes addressing both halves of #958: 1. IPv6 highlighting The built-in 'URL, IP & MAC' rule only shipped URL, IPv4 and MAC patterns, so compressed IPv6 addresses such as 2001:11:22:33::5 or fe80::d2dd:bff:fe79:f2bb were never highlighted. Add an IPv6 regex covering full and compressed forms (including ::1 and leading-/trailing- :: variants) and merge it into the same 'ip-mac' rule's patterns. The normalizer's existing "fill missing defaults" path means existing users pick this up on next start with no migration step. 2. Editable built-in rules Add an optional `customized` flag to KeywordHighlightRule. When false / absent, normalize re-syncs the rule's label/patterns with the shipped defaults (so future default-pattern upgrades reach users automatically). When true, normalize keeps the user's label/patterns/color/enabled verbatim, allowing built-ins like 'ip-mac' to be tailored. SettingsTerminalTab: - Pencil icon now appears on built-ins too. Editing one routes through the same dialog and flips `customized` on save. - The pattern field becomes a Textarea so multi-pattern built-ins (e.g. 'error' ships seven spellings) can all be edited in one go. - A per-rule "↺" reset icon appears on customized built-ins and restores the shipped label/patterns while preserving the user's color/enabled. - The footer's "Reset to default colors" button is broadened into "Reset built-ins to defaults", restoring every built-in to shipped label/patterns/color and clearing `customized`. Tests: New domain/keywordHighlight.test.ts (6 tests) covers IPv6 matches for both #958 examples plus loopback and full-form, IPv4/MAC still match, normalize migrates legacy non-customized 'ip-mac' to include IPv6, normalize preserves customized patterns, and normalize keeps user custom rules verbatim. Full suite: 808/0/3. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|
|
ea5320d94a |
Fix #954: unify Tooltip styling + replace native selects (#961)
* Fix #954: unify Tooltip styling + replace native selects Replace native HTML title= tooltips and native <select> dropdowns with the existing Radix-based Tooltip / Select components so they share the app's rounded styling, theme tokens and i18n pipeline. Adds a global TooltipProvider in AppWithProviders so every descendant Tooltip works without a per-file Provider wrapper. Scope (driven by the issue #954 examples and "全部都处理" follow-up): - TerminalLayer toolbar: Add Terminal / Split View / SFTP / Scripts / Theme / AI Chat / Move panel / Close panel. - TopTabs middle bar: quick switcher, more tabs, AI assistant, theme toggle, settings; window-control buttons (min/max/close), tray close and hotkey reset/disable have their native title dropped per the user's explicit opt-out ("可以不用Tooltip,直接全局禁用 原生title 属性"). - AI panels: AIChatSidePanel session history / new chat / delete, ConversationExport, AgentSelector, ChatInput attach / expand / permission, ModelSelector, ProviderCard, ai-elements/tool-call. - SFTP: SftpSidePanel header, SftpBreadcrumb, SftpFileRow, SftpPaneToolbar, SftpTabBar, SftpTransferQueue. - Settings: SettingsPage close, SettingsAppearanceTab theme/accent swatches, SettingsFileAssociationsTab edit/remove, SettingsSystemTab crash-log paths and global hotkey reset. - Host vault: HostDetailsPanel (clear / suggestions / show-password / key path / browse key), GroupDetailsPanel, KnownHostsManager, ConnectionLogsManager, KeychainManager, SyncStatusButton, CloudSyncSettings, LogView, QuickSwitcher, ScriptsSidePanel, Terminal status bar copy-host + broadcast/focus, ZmodemProgressIndicator. - Terminal subcomponents: HostKeywordHighlightPopover, TerminalComposeBar, TerminalConnectionDialog, TerminalSearchBar. - Editor: TextEditorPane (subtitle, search, wrap, promote-to-tab). - TrayPanel session rows and port-forwarding rows. Native <select> migrated to custom Select component: - SerialConnectModal (data bits, stop bits, parity, flow control) - SerialHostDetailsPanel (same four fields) - HostDetailsPanel backspace behavior - GroupDetailsPanel backspace behavior - SettingsTerminalTab local shell picker - terminal/ThemeSidePanel font weight Hardcoded English strings extracted to i18n. New keys for both en and zh-CN: terminal.layer.*, topTabs.*, ai.chat.* (sessionHistory, attach, collapse, expand, enableAgent), zmodem.*, settings.shortcuts. resetToDefault. Inline help text on SnippetsManager package-name input removed because the same hint is already shown in a visible <p> below the input. Existing per-file <TooltipProvider> wrappers (SnippetsManager, ScriptsSidePanel, SelectHostPanel, RuleCard, HostDetailsPanel proxy section) are left in place — they nest harmlessly under the global provider and stay self-sufficient for component tests. Tests: - tsc clean for changed files (pre-existing repo-wide errors unrelated to this PR). - All 802 tests pass (3 skipped pre-existing). - HostDetailsPanel.proxyProfile.test and TextEditorPane.test updated to wrap with TooltipProvider, matching the runtime context now needed by the migrated components. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Fix #954: wrap Settings + Tray windows with TooltipProvider Settings and the tray panel mount as separate Electron windows with their own React root in index.tsx, so they do not inherit the global TooltipProvider added under AppWithProviders. After the unified Tooltip migration, any settings tab that used a Tooltip (Appearance, Application, FileAssociations, System, Shortcuts, Terminal, AI ProviderCard, AI ModelSelector) — and TrayPanel — threw "Tooltip must be used within TooltipProvider" and rendered nothing. Wrap both branches with TooltipProvider at the same level as ToastProvider in index.tsx. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|
|
92ecd84edf |
Fix #939: per-host SSH keepalive override + cloud-friendly defaults (#947)
* fix(ssh): per-host keepalive override + cloud-friendly defaults (#939, #581)
Issues #939 (cloud / Aliyun sessions silently freezing after 15-20 min idle
because no SSH keepalive packets are sent) and #581 (older routers like
NOKIA / ALCATEL being killed by ssh2 after a few unanswered keepalives) are
in direct tension at the global-setting level: cloud users want keepalive
ON, embedded-device users want it OFF, and any single global default hurts
the other group.
Resolves the conflict by moving keepalive to a per-host setting (mirroring
the existing `legacyAlgorithms` per-host pattern), with cloud-friendly
global defaults:
Domain:
- Host gains `keepaliveOverride?: boolean` + `keepaliveInterval?: number`
+ `keepaliveCountMax?: number`. When override is true, the host's
values are used; otherwise the global TerminalSettings values apply.
Per-field fallback so a host can override interval only or countMax only.
- TerminalSettings gains `keepaliveCountMax: number` so the second knob
(number of unanswered keepalives before declaring dead) is no longer
hardcoded at 3 in the bridge.
- DEFAULT_TERMINAL_SETTINGS: keepaliveInterval bumped from 0 to 30, and
keepaliveCountMax = 10. Cloud LBs / NAT tables stay populated; brief
network glitches don't trip the dead-connection check; an actually
dead session is detected within ~5 minutes. Existing users with 0
saved keep their value (no migration) — they were the #581 router
cohort and their setup still works untouched.
Plumbing:
- domain/host.ts adds resolveHostKeepalive(host, globalSettings) with
five unit tests covering both directions of the override flag and
per-field fallback.
- components/terminal/runtime/createTerminalSessionStarters.ts uses the
resolver when building startSSHSession options.
- electron/bridges/sshBridge.cjs reads keepaliveCountMax from options
(defaulting to 10) at both connection sites (direct + jump host) and
still routes interval=0 through to a fully disabled keepalive
(preserving #581's escape hatch).
UI:
- Settings → Terminal → Connection grows a second input next to the
existing interval: "Max unanswered keepalives".
- Host details panel gains a Keepalive section with a "Override global
keepalive" toggle that, when on, exposes per-host interval +
countMax inputs and an inline hint when interval = 0 (explaining
the implications). Same visual pattern as the existing Legacy
Algorithms section.
Sync:
- keepaliveCountMax added to SYNCABLE_TERMINAL_KEYS so the new global
field rides existing sync infrastructure. Per-host fields ride the
hosts array passthrough automatically (older clients receiving them
ignore unknown fields, per the existing lenient sync contract).
i18n: en + zh-CN strings for the new settings row, the host section
header, and the override toggle / inputs / disabled hint.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix(ssh): resolve keepalive per jump host, not just the final target
Addresses codex review on PR #947:
https://github.com/binaricat/Netcatty/pull/947#discussion_r3217027xxx
The first cut only resolved keepalive for the final target host and
forwarded a single interval/countMax pair across the whole start-SSH
call. connectThroughChain in sshBridge.cjs then applied that one pair
to every hop, so a chain like:
router (bastion, needs keepalive=0) → cloud target (needs 30s)
would either kill the router (with cloud-friendly defaults) or fail
to keep the target alive (with router-friendly 0). The per-host
override was effectively useless for bastion hosts.
Fix:
- NetcattyJumpHost gains optional keepaliveInterval / keepaliveCountMax.
- createTerminalSessionStarters runs resolveHostKeepalive() per
jumpHost when building the chain, so each hop carries its own
resolved pair.
- sshBridge.cjs's chain connector reads jump.keepaliveInterval /
jump.keepaliveCountMax for each hop, falling back to the call's
target-level options for backward compatibility with older
serializers that don't yet populate the per-hop fields.
The final target's keepalive path is unchanged — it still reads
options.keepaliveInterval / options.keepaliveCountMax that the
session starter resolves from the target host.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix(ssh): per-host keepalive for SFTP + port forwarding too
Follow-up to the maintainer review on PR #947 — terminal SSH was the
only path that honored per-host keepalive overrides. SFTP and port
forwarding share the same NetcattyJumpHost type but their builders
weren't resolving keepalive per-hop, and their bridges hardcoded the
old 10s/3 defaults. Net result: a router-as-bastion in a chain still
got killed when reached via the SFTP file panel or a port-forwarding
tunnel, even though the user had toggled per-host override.
Plumbing:
- useSftpHostCredentials / buildSftpHostCredentials: accept optional
terminalSettings; call resolveHostKeepalive() for the target and
each jump entry; emit keepaliveInterval / keepaliveCountMax in the
returned NetcattySSHOptions.
- useSftpConnections + useSftpState + SftpStateOptions thread the
setting down. SftpSidePanel passes the global terminalSettings prop
it already has from TerminalLayer.
- portForwardingService.startPortForward: accepts terminalSettings
as an 8th argument, resolves per-host (target + each jump), and
populates the bridge payload.
- usePortForwardingState.startTunnel and usePortForwardingAutoStart
forward the new parameter; App.tsx supplies terminalSettings (via
a ref in the once-on-launch auto-start effect so changing global
keepalive later doesn't re-fire it).
Bridges:
- sftpBridge.cjs target connect: now also reads keepaliveCountMax
from options (was hardcoded 3). 10s/3 stays as the bridge-level
fallback to preserve the #669 protection when the renderer hasn't
supplied a value.
- sftpBridge.cjs jump hop: reads jump.keepaliveInterval /
jump.keepaliveCountMax, then falls back to the target-call options
(matches the symmetric SSH bridge change).
- portForwardingBridge.cjs: reads keepaliveInterval /
keepaliveCountMax from the IPC payload; same 10s/3 fallback.
Types:
- NetcattyJumpHost already grew keepalive fields earlier; this
commit also adds them to PortForwardOptions so the IPC contract
is explicit.
End-to-end: a chain `[router-as-bastion, cloud-host]` with the
router host's keepaliveOverride=true / interval=0 now correctly
disables keepalive on the router hop for terminal SSH AND SFTP AND
port forwarding, while the cloud target still gets the resolved
30s/10 default for each path.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix(ssh): honor explicit keepalive=0 in SFTP + port forwarding bridges
Addresses codex review on PR #947:
- https://github.com/binaricat/Netcatty/pull/947#discussion_r3217448xxx
- https://github.com/binaricat/Netcatty/pull/947#discussion_r3217449xxx
The previous follow-up commit (
|
||
|
|
92dd898eb4 |
Fix #931: let users pick a CJK font + per-font smart pairing (#940)
* feat(fonts): add CJK font pairing composition module Introduces composeFontFamilyStack() which builds the xterm fontFamily CSS string at runtime from: - the user's primary Latin font - an explicit CJK font (TerminalSettings.fallbackFont) if set - otherwise a per-Latin-font recommended CJK pairing - a hardcoded system CJK fallback stack - a Nerd Font icon fallback stack - the universal monospace generic 14 unit tests cover composition order, deduplication, OS defaults, quoting, and recommendation override behavior. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * refactor(fonts): expose raw Latin families and add CJK-coverage entries - TERMINAL_FONTS[].family no longer bakes in the CJK fallback stack; composition is deferred to runtime via composeFontFamilyStack(). - Drops withCjkFallback helper from this module and its caller in lib/localFonts.ts. - Adds 6 CJK-coverage primary fonts to the dropdown: Sarasa Mono SC/TC, Maple Mono CN, LXGW WenKai Mono, Microsoft YaHei UI, PingFang SC. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * feat(terminal): compose font-family stack with user-configurable CJK fallback resolvedFontFamily now passes through composeFontFamilyStack(), which prepends the user's TerminalSettings.fallbackFont (if set) ahead of the per-Latin-font recommended CJK pairing and the system fallback stack. The platform argument is derived from navigator.platform inside the useMemo, so the same Latin font may pair with PingFang SC on macOS and Microsoft YaHei UI on Windows out of the box. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * feat(settings): add CJK font picker to terminal settings Adds a new "CJK font" select row right under the main font selector in the Terminal settings tab. Bound to TerminalSettings.fallbackFont (an already-existing-but-unused field), so this needs no schema or sync payload change. Default value "Auto" leaves fallbackFont empty, which lets the new per-Latin-font pairing in cjkFonts.ts pick a CJK font automatically. Selecting any explicit option (Sarasa Mono SC, PingFang SC, Microsoft YaHei UI, etc.) takes precedence over the per-font pairing. Includes en + zh-CN i18n strings. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * test(sync): cover fallbackFont round-trip + legacy payload tolerance Four new test cases verify cloud-sync compatibility for the new CJK font setting: - buildSyncPayload includes fallbackFont when set - buildSyncPayload omits fallbackFont when unset - applySyncPayload writes incoming fallbackFont to TERM_SETTINGS - applySyncPayload from a legacy client (no fallbackFont) does NOT wipe the local value — critical for old-to-new upgrades Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * feat(fonts): add font availability detection (canvas + document.fonts API) Three-layer detection used by isFontInstalled(family): 1. Known @fontsource-bundled families (e.g. JetBrains Mono) always count as installed. 2. document.fonts.check() — picks up @font-face and system-loaded fonts. 3. Canvas width measurement against serif / sans-serif / monospace fallbacks; only counts if the target font produces a width that differs from ALL three generics for a probe string. detectInstalledWithContext is a pure function taking an injected measurement context, which keeps the canvas / DOM behind a seam and lets the logic be unit-tested without a browser. 11 tests cover quoted-family parsing, the three-generic-fallback rule, bundled short-circuit, and document.fonts.check fast-path. Results are cached per process; clearFontAvailabilityCache() invalidates. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * feat(fonts): filter dropdowns to fonts actually installed on this machine Layer 3 of #931 added Sarasa Mono SC / Maple Mono CN / Microsoft YaHei UI / PingFang SC etc. to the terminal font dropdown, but users who don't have these installed would still see them and pick them — resulting in "I changed the font and nothing happened" confusion. This commit filters both dropdowns through isFontInstalled(): - TerminalFontSelect: drops any built-in or system-discovered font that detection can't render. If filtering would leave fewer than 4 fonts (detection misfire safety net), shows the full list. - TerminalCjkFontSelect: keeps the "Auto" sentinel always, drops concrete CJK choices that aren't present on this machine. Both selects always keep the currently-selected value visible — even when the underlying font is missing — so users can read and clear their setting without surprise. Also expands `npm test` globs to pick up infrastructure/config/*.test.ts and lib/*.test.ts, which previously matched no patterns and meant the new cjkFonts and fontAvailability suites were silently excluded from CI runs. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(fonts): never recommend proportional CJK fonts for terminal use The previous PingFang SC / Microsoft YaHei UI / Hiragino Sans GB choices were proportional sans-serif fonts whose CJK glyphs aren't designed to fit a terminal's 2x cell grid — the rendered Chinese ended up visibly wider than its allocated cells, breaking grid alignment (reported on macOS with PingFang SC selected as the CJK font). Changes: - TerminalCjkFontSelect: drops PingFang SC / Microsoft YaHei UI / Hiragino Sans GB from the dropdown. Legacy explicit selections still surface as a synthetic "not recommended" option so users can see and re-pick. - CJK_SYSTEM_FALLBACK_FONTS: monospace-only list. Sarasa Mono SC/TC, Maple Mono CN, LXGW WenKai Mono, Noto Sans Mono CJK SC, Source Han Mono SC, NSimSun, SimSun. Proportional fonts removed. - PER_FONT_CJK_PAIRING: every entry now points at a true monospace CJK font. Cascadia / Consolas / Menlo etc. all recommend Sarasa Mono SC, which the next commit bundles via @font-face. - getDefaultCjkFallback: Windows = SimSun (always installed, monospace); macOS = Sarasa Mono SC (will be bundled); Linux = Noto Sans Mono CJK SC. A regression test enforces that no per-OS default is a known proportional font. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * feat(fonts): bundle Sarasa Mono SC as the universal CJK monospace Previous commit removed proportional CJK fonts (PingFang SC, etc.) from the picker and switched per-OS defaults to true monospace, but macOS ships NO system-installed monospace CJK font — leaving macOS users with a broken default unless they manually install Sarasa or similar. This commit closes that gap by bundling Sarasa Mono SC as an @font-face webfont, so the recommended pairings and macOS default "just work" out of the box. Details: - public/fonts/SarasaMonoSC-Regular.woff2 (~4.8 MB): subsetted from be5invis/Sarasa-Gothic v1.0.37 SarasaMonoSC-Regular.ttf (24 MB). Covers ASCII, Latin-1, common punctuation/symbols, CJK Unified Ideographs main block, Hiragana/Katakana, halfwidth/fullwidth, box-drawing — the everyday-Chinese coverage that matters for a terminal. Rare CJK Ext-A/B/historical chars fall through to the system fallback stack. - public/fonts/SarasaMono-LICENSE.txt: OFL-1.1 verbatim, required by the license. - index.css: @font-face declaration with font-display: swap so the user doesn't see a flash of nothing while the woff2 loads. - KNOWN_BUNDLED_FAMILIES: "Sarasa Mono SC" added so the dropdown availability filter doesn't hide it. Installer impact: ~+4.8 MB (vs current ~100-200 MB Electron baseline). The font replaces what would otherwise have been "Chinese chars look broken in the terminal" for every macOS user without a manually installed CJK monospace font. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(fonts): use Local Font Access API as the authoritative install check document.fonts.check() turned out to be unreliable as an installed-font signal in Chromium — it returns true for any syntactically-valid family name regardless of whether the font is actually installed, as a deliberate fingerprinting-mitigation. The previous detector took it as a positive signal and ended up keeping uninstalled fonts in the dropdown (reported by a macOS user seeing dozens of fonts they don't have). This commit pivots the detection chain: - lib/localFonts.ts: getAllSystemFontFamilies() exposes the unfiltered set of installed family names from queryLocalFonts(), reusing the same underlying call as getMonospaceFonts() via a shared cache. - lib/fontAvailability.ts: drops the document.fonts.check fast-path. Adds setSystemFamilies() / hasAuthoritativeData(). When the set has been populated, isFontInstalled answers from membership lookup directly — no canvas guessing. Canvas remains as a fallback for environments where the Local Font Access API is unavailable or permission is denied. - application/state/fontStore.ts: during initialize(), runs the monospace-only query and the full-system-families query together, then pipes the result into fontAvailability. - TerminalFontSelect: with authoritative data, drops the "if filtered list is suspiciously small, show all" safety net. Empty would now really mean empty (highly unlikely since Sarasa Mono SC is bundled). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(fonts): drop PingFang SC / Microsoft YaHei UI from primary dropdown Step 1 of this PR removed proportional CJK fonts from the CJK fallback picker but left them in BASE_TERMINAL_FONTS, so PingFang SC and Microsoft YaHei UI were still selectable as the *primary* terminal font. Picking PingFang SC as primary produced visibly bloated Latin character spacing (xterm.js samples cell width from the primary font; the wide proportional 'M' inflates every cell), reported by a macOS user in the same thread that opened #931. Both entries are removed from BASE_TERMINAL_FONTS. A new infrastructure/config/fonts.test.ts asserts that no known proportional CJK font name (including PingFang TC/HK, Microsoft YaHei variants, Hiragino Sans GB, Heiti SC/TC) is ever shipped in TERMINAL_FONTS as a primary choice. Migration for users already saved to one of the removed ids: useSettingsState rewrites STORAGE_KEY_TERM_FONT_FAMILY to the default (Menlo) on read when it sees a deprecated id, so the bad value also stops getting carried into cloud-sync uploads. Per-host fontFamily overrides are NOT migrated automatically — they still gracefully fall through to the dropdown's first entry via the existing getFontById fallback; users can re-pick from the host settings UI. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(fonts): drop Comic Sans MS — it's a proportional handwriting font Same symptom as the PingFang SC / Microsoft YaHei UI removal: Comic Sans MS was historically in the primary font dropdown labeled "Casual, non-traditional terminal font", but Comic Sans is a handwriting-style proportional sans-serif. Picking it as the terminal primary inflates cell width and spaces every Latin character far apart (reported in the same #931 thread). - BASE_TERMINAL_FONTS: comic-sans-ms entry removed. - DEPRECATED_PRIMARY_FONT_IDS: gains comic-sans-ms so existing selections silently migrate to Menlo on read. - fonts.test.ts: the proportional-font ban list now also covers Latin proportional fonts (Comic Sans MS, Arial, Helvetica, Times New Roman, Georgia, Verdana, Trebuchet MS, Tahoma) so the test catches any future mislabeled body-text font from being added to the terminal dropdown. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(fonts): keep monospace ahead of CJK fallbacks in composed stack Addresses codex P1 review comment on PR #940 (https://github.com/binaricat/Netcatty/pull/940#discussion_r3216017737). The previous behavior of withCjkFallback() had monospace immediately after the primary family, before any CJK fallback. composeFontFamilyStack had moved monospace to the very end, which means: when the primary font isn't installed on the user's machine (common for Layer 3 CJK choices that aren't bundled and not present on a given OS, or for any built-in id like cascadia-code on a Linux system without it), CSS per-glyph fallback resolves Latin glyphs from a CJK font's full-width Latin variants before ever reaching monospace generic. That breaks xterm.js's fixed cell-grid alignment. The composed stack now reads: <primary>, monospace, <userFallback>, <recommended-cjk>, <system-cjk-stack>, <nerd-font-stack> Per-glyph CSS fallback behavior: - Latin → primary if installed → monospace generic. Cell width stays consistent. - CJK → primary (no) → monospace (no Chinese glyphs) → walks into CJK fallbacks. - Nerd PUA → falls past all of the above into the Nerd Font stack. Updates the position-invariant tests and adds a regression test that explicitly asserts monospace appears before every CJK family in the output stack. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(fonts): dedupe Local Font Access API calls under concurrent init Addresses codex P2 review on PR #940: https://github.com/binaricat/Netcatty/pull/940#discussion_r3216246xxx fontStore.initialize() runs getMonospaceFonts() and getAllSystemFontFamilies() in Promise.all; both internally called queryAllSystemFontsOnce(), whose cache check (`if (cache) return`) was only useful once the result had been written. Concurrent callers both passed the empty-cache check and fired their own queryLocalFonts() request — two real Local Font Access API invocations on cold start, with the risk of one succeeding while the other was denied (leaving the authoritative set unset). Fix: cache the *in-flight promise itself*, so subsequent callers await the same single invocation. The first await populates the family-set cache as a side effect, and the resolved promise keeps returning the same value to every subsequent caller. Adds lib/localFonts.test.ts with three regression tests: - concurrent getMonospaceFonts + getAllSystemFontFamilies = 1 API call - sequential repeats also reuse the resolved promise - missing API returns null authoritative set (canvas fallback signal) Exports __resetLocalFontsCacheForTesting() so each test gets a fresh module-level state. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(fonts): retry LFA on transient failure + notify on availability changes Two follow-up fixes from codex P2 review on PR #940: 1) queryAllSystemFontsOnce() previously kept its in-flight promise even when queryLocalFonts threw. Subsequent callers reused the cached empty result for the rest of the session, so any transient failure at boot (permission state not ready, AbortError, etc.) permanently blinded the rest of the app to installed fonts. Catch now clears queryPromise so the next caller retries. Regression test added. 2) TerminalCjkFontSelect.visibleOptions and TerminalFontSelect .visibleFonts were memoized on [value] / [fonts, value] only, but the filter calls isFontInstalled() which reads module-level systemFamilies — a value that arrives asynchronously after the initial render. The memos never recomputed when authoritative availability data landed, so the dropdowns could continue showing stale "filtered" results until the user changed selection. fontAvailability now exposes subscribeFontAvailability() and getFontAvailabilityVersion() (monotonic counter bumped on setSystemFamilies / clearFontAvailabilityCache). Both selects subscribe via useSyncExternalStore and include the version in their memo deps; tests cover subscriber notification and version monotonicity. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(fonts): migrate host/group deprecated font ids + localize CJK labels Two follow-up fixes from codex review on PR #940: P2 — Host/group level font migration ==================================== The earlier deprecated-id migration only rewrote STORAGE_KEY_TERM_FONT_FAMILY, so hosts and group configs that had explicitly opted into a now-removed font id (e.g. pingfang-sc, microsoft-yahei, comic-sans-ms) kept `fontFamily` set with `fontFamilyOverride=true`. After the dropdown entries were dropped in 9f2bd282/c9b622d8, those records silently fell through to the first font in the registry (Menlo) while the override flag still read "true" — users saw a host claiming a custom font but rendering the global default with no way to tell what happened. Fix: - infrastructure/config/fonts.ts gains migrateDeprecatedFontOverride(), a structurally-shared helper that drops fontFamily and clears fontFamilyOverride when the id is deprecated. - sanitizeHost now runs it on every host load. - domain/groupConfig.ts grows sanitizeGroupConfig(); useVaultState applies it both on initial load and on cross-tab storage events. - Existing decrypt → sanitize → encrypt round-trip in useVaultState means the migrated values are persisted back to localStorage and propagate through cloud sync naturally. Tests: two each in domain/host.test.ts and domain/groupConfig.test.ts covering deprecated-id reset and untouched-valid-id preservation. P3 — Localize CJK font option labels ==================================== TerminalCjkFontSelect previously hardcoded Chinese option labels ("Auto · 按主字体智能搭配", "Sarasa Mono SC (更纱黑体 简)", etc.) and the synthetic "not recommended" warning. Non-Chinese locales saw a mixed-language UI despite the rest of the setting going through i18n. OPTIONS now references i18n keys; the component looks them up via useI18n(). Both en and zh-CN locales gain matching keys, including `...option.legacy` with `{font}` interpolation for the synthetic "not recommended" item that surfaces saved-but-removed values. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(fonts): also sanitize group configs on the write/import path Addresses codex P2 review on PR #940: https://github.com/binaricat/Netcatty/pull/940#discussion_r3216314xxx The previous commit ( |
||
|
|
d86c5ed05a |
[codex] Remove mosh client path setting (#878)
* fix(terminal): remove mosh client path setting * fix(terminal): remove stale mosh detection bridge |
||
|
|
b6734b9ef9 | Show auto-detected mosh path (#858) | ||
|
|
74d56cdcb8 |
[codex] Settings: detect & override mosh client path (#849)
* Add Mosh client detection and override in Settings → Terminal Builds on PR #847 (auto-detection across PATH gaps). Power users with non-standard install locations (containers, custom builds, multiple mosh versions) can now point the app at a specific mosh binary; less technical users get a one-click "Detect" button to confirm where mosh was found, with a Browse fallback for clicker-only flows. Backend (electron/bridges/terminalBridge.cjs): - detectMoshClient() returns { platform, found, path, searchedPaths }. Reuses resolvePosixExecutable; surfaces the searched dirs so the UI can tell users where to look when nothing was found. - pickMoshClient() opens a native file picker via dialog.showOpenDialog. - startMoshSession honors options.moshClientPath when provided. Strict failure: a missing/non-executable explicit path produces a clear error instead of falling back to auto-detect, so users notice typos and stale paths instead of getting silent recovery. UI (components/settings/tabs/SettingsTerminalTab.tsx): - New SettingRow under "Connection" with text input + Detect + Browse buttons, mirroring the localShell validation pattern. Shows inline validation (notFound/isDirectory) and the last detect result with searched directories on miss. Plumbing: - TerminalSettings.moshClientPath: string field with default "" so empty == auto-detect (matches existing PR #847 semantics). - preload exposes detectMoshClient + pickMoshClient. - createTerminalSessionStarters passes terminalSettings.moshClientPath into the IPC call, undefined when blank. - en.ts / zh-CN.ts get the 9 new strings. Verified locally: - vite build succeeds; settings tab renders. - detectMoshClient() against the live machine returns /opt/homebrew/bin/mosh with the expected searchedPaths list. - Existing PR #847 auto-detection path is unchanged when the field is empty. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Skip POSIX execute-bit check for explicit Windows mosh path Address Codex P2 on PR #849 commit |