Commit Graph

18 Commits

Author SHA1 Message Date
TachibanaLolo ca91483d01 Merge upstream/main 2026-01-21 23:13:31 +08:00
bincxz 2fde490ee7 fix: use 3-value renderer option to preserve low-memory auto fallback
Change rendererType from boolean to 'auto' | 'webgl' | 'canvas':
- 'auto' (default): Uses Canvas on low-memory devices (<=4GB), WebGL otherwise
- 'webgl': Force WebGL renderer
- 'canvas': Force Canvas renderer

This preserves the automatic low-memory device detection that was
inadvertently disabled when always passing a boolean value.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-21 18:39:39 +08:00
bincxz b6d0a3c698 fix: add renderer selection setting and fix serial port dropdown
- Add renderer selection (WebGL/Canvas) in terminal settings
- Remove macOS restriction for Canvas renderer, allow all platforms
- Fix Combobox dropdown to show all options when opened instead of
  filtering by current value
- Add i18n translations for new rendering settings

Closes #80

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-21 18:28:58 +08:00
bincxz a855323912 refactor: use xterm Decoration API for keyword highlighting
Replace ANSI escape sequence-based text processing with xterm.js's
Decoration API for keyword highlighting. This "lazy" approach only
processes visible viewport rows and uses debounced refresh, ensuring
zero impact on scrolling performance.

Key changes:
- New KeywordHighlighter class using IDecoration/IMarker APIs
- Decorations refresh on scroll, write, and resize events
- Skip highlighting in alternate buffer (vim, htop, etc.)
- Add configurable debounce delay (200ms default)
- Remove inline ANSI color injection from data stream

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-21 11:00:34 +08:00
bincxz a21970a278 Refactors terminal paste line ending normalization
Extracts the logic for normalizing line endings (CRLF to LF) during clipboard paste operations into a shared utility function.

This improves code reusability and consistency across different paste mechanisms, ensuring that pasted content always uses Unix-style line endings and prevents issues like extra blank lines in the terminal.
2026-01-20 13:56:05 +08:00
copilot-swe-agent[bot] c07fd505d3 Fix: Normalize CRLF to LF when pasting text to prevent extra blank lines
Co-authored-by: binaricat <16399091+binaricat@users.noreply.github.com>
2026-01-20 04:21:58 +00:00
LAPTOP-O016UC3M\Qi Chen c3c23d042f refactor: replace useFontState hook with global fontStore singleton
- Create fontStore.ts with useSyncExternalStore pattern (matches project style)
- Eliminate props drilling (availableFonts through 5+ layers)
- Improve font detection with KNOWN_MONOSPACE_FONTS (50+ fonts)
- Add eager initialization at app startup
- Remove unused useFontState.ts
- Components now use useAvailableFonts()/useFontById() directly
2026-01-08 18:05:15 +08:00
LAPTOP-O016UC3M\Qi Chen 3263676996 fix: Address PR review comments for local font support
- Improve font filtering logic with word boundary matching to avoid false positives
- Rename snake_case variable to camelCase (mono_fonts -> monoFonts)
- Translate Chinese comments to English
- Add TypeScript type definitions for Font Access API
- Check API availability before calling queryLocalFonts
- Apply CJK fallback fonts to local fonts
- Add 'local-' prefix for local font IDs to avoid collisions
- Handle permission denied gracefully
- Use TERMINAL_FONTS as default for availableFonts
- Add safer fallbacks for empty availableFonts in all components
- Export withCjkFallback function for reuse
2026-01-08 17:53:46 +08:00
qi-xmu 6a76287bf7 Add local mono fonts support 2026-01-08 15:38:20 +08:00
LAPTOP-O016UC3M\Qi Chen d6db6c5db1 Adds Monaco-based syntax highlighting editor and OSC 7 CWD sync
Integrates Monaco Editor for enhanced syntax highlighting in the text editor modal, improving editing experience for code and config files.

Tracks and synchronizes the terminal's current working directory via OSC 7 escape sequences, enabling SFTP dialogs to open at the detected shell path even after user or directory changes.

Introduces IPC and backend support for querying the current shell directory from active SSH sessions, with fallback and path validation logic for remote SFTP browsing.

Improves file type detection by analyzing file content in addition to extensions.

Updates i18n strings and UI elements for clarity and future system application integration.

Adds necessary dependencies for Monaco Editor and updates content security policy for web workers.
2026-01-07 21:09:07 +08:00
bincxz 05345d1ac7 Adds serial local echo and line mode terminal options
Enhances serial terminal usability by introducing configurable options
for forced local echo and line mode (buffer input, send on Enter).
Improves cross-platform compatibility by handling newlines to avoid
display artifacts, and updates UI to allow manual port entry and
clearer feedback for serial connections.
2026-01-05 22:39:53 +08:00
LAPTOP-O016UC3M\Qi Chen c6fdfc0123 Adds main-process cloud sync support with detailed errors
Enables network operations for cloud sync providers (WebDAV, S3)
to be proxied via the main process, improving reliability and
support for Electron environments.

Improves error reporting for cloud sync connections with
detailed, context-rich error messages in the UI to assist
debugging and user support.

Refines hotkey debug logging, only enabling verbose output
when explicitly requested.

Relates to user-reported sync reliability and error clarity.
2025-12-22 18:15:50 +08:00
LAPTOP-O016UC3M\Qi Chen 8718445ebd Removes unused hotkey action references
Cleans up code by eliminating unnecessary imports and unused variables
related to global hotkey actions. Improves maintainability without
affecting existing functionality.
2025-12-19 10:34:05 +08:00
bincxz 00481a20ee Improves hotkey handling between app and terminal
Refines detection of terminal and input contexts to ensure global hotkeys are only processed at the appropriate level, preventing conflicts between app-level and terminal-level shortcuts. Adds enhanced logging for easier debugging during development. Enables more reliable hotkey behavior and a smoother user experience.
2025-12-19 07:21:42 +08:00
bincxz 1a4c6ade9f Enables local terminal customization for theme and font
Allows users to customize theme, font family, and font size for local terminals independently of remote host settings. Improves user experience by making appearance preferences for local sessions more flexible and immediately responsive.
2025-12-18 00:22:54 +08:00
LAPTOP-O016UC3M\Qi Chen a7e016c394 Improves terminal command execution status handling
Replaces status prop with a ref to ensure up-to-date session status
during command execution checks, preventing stale state issues.
Also updates Chinese translations for code package terminology for
consistency and clarity.
2025-12-17 20:55:50 +08:00
LAPTOP-O016UC3M\Qi Chen 21c07ffe11 Replaces MutableRefObject with RefObject for refs
Updates type annotations across terminal-related hooks and runtime modules to use RefObject instead of MutableRefObject for React refs. Aligns with React's convention for refs not directly assigned via useRef, improving type safety and clarity.
2025-12-15 19:15:43 +08:00
LAPTOP-O016UC3M\Qi Chen 30c2df29be Refactors terminal logic into modular hooks and runtimes
Improves maintainability and code clarity by extracting authentication, search, and context menu behaviors into dedicated hooks. Moves terminal session logic into runtime/session-starter modules, reducing component complexity. Removes inline implementations in favor of reusable abstractions, streamlining prop and state management throughout the terminal UI.

Enables easier future enhancements and testing by promoting separation of concerns and reducing code duplication.
2025-12-15 19:05:13 +08:00