Commit Graph
507 Commits
Author SHA1 Message Date
Kang 98ebed771b fix(monitoring): relax NIC detection for virtualized hosts 2026-09-06 20:46:56 +08:00
Kang f4e8b499f6 refactor(stats): streamline session management in RemoteStatsSampler (#545)
- Removed the dependency on RemoteStatsSampler in the close_session function.
- Introduced session locking mechanism to prevent race conditions when fetching remote stats.
- Updated the stats fetching logic to utilize a probe plan for better efficiency.
- Enhanced the RemoteStatsSampler to manage session states and ensure proper cleanup of session data.
2026-09-06 10:31:13 +08:00
Kang 6089f09cce fix(ssh): cancel pending integration before capture exec 2026-09-05 00:57:58 +08:00
victorwon2001 fd1be4f8c2 fix(ssh): 避免初始集成注入吞掉用户输出 2026-09-04 22:21:55 +09:00
victorwon2001 1af67dacef fix: 修复 Windows 本地终端路径同步 2026-09-04 12:53:37 +09:00
victorwon2001 74b13dbf86 fix(zmodem): 改用非阻塞文件选择器 2026-09-04 09:45:10 +09:00
Kang 5fa177737f fix(ssh): adjust injection timeout and enhance suppression diagnostics (#564)
- Reduced the injection timeout from 30 seconds to 8 seconds for improved responsiveness.
- Introduced a new `SuppressionDiagnostics` struct to track and log suppression metrics.
- Updated the injection handling logic to incorporate the new diagnostics and timeout mechanisms.
- Refactored related functions for clarity and maintainability.
2026-09-04 00:39:34 +08:00
Kang b148948623 refactor(terminal): change default behavior for reconnecting to previous working directory
- Updated the default setting for reconnecting to the previous working directory from true to false across various components and settings.
- Adjusted related tests to reflect the new default behavior.
2026-09-03 20:01:03 +08:00
lly 93fa27b54a merge: update SSH reconnect branch with upstream main 2026-09-03 17:02:47 +08:00
lly 0faa75dc0f fix(terminal): harden SSH reconnect cwd restoration 2026-09-03 16:36:44 +08:00
Kang 2ea9abf0ea feat(ssh): implement bash history pruning in injection script
- Introduced a mechanism to prune bash history entries within a defined range, enhancing the management of command history.
- Added a new constant for maximum history entries and updated the injection script to utilize this feature.
- Improved the script's logic to ensure proper handling of history entries, including marking the beginning and end of relevant history sections.
2026-09-03 10:17:23 +08:00
Kang 18fdae9b81 fix(ssh): improve injection script formatting and readability
- Reformatted the injection script in `osc.rs` to enhance clarity and maintainability.
- Consolidated multiple lines into a single compound entry while ensuring compliance with remote PTY input limits.
- Updated function comments for better understanding of the script's purpose and functionality.
2026-09-03 09:50:57 +08:00
lly 8878f0a71e feat(terminal): restore last working directory on SSH reconnect 2026-09-02 16:33:58 +08:00
Kang 3685459dd1 feat(ai): enhance AI stream control event handling and add localization for MCP errors
- Introduced `classifyAIStreamControlEvent` to categorize AI stream events as "warning", "done", or "error", improving event management.
- Updated `AIAssistantPanel` to handle new event types, displaying appropriate warnings and error messages based on the event kind.
- Added localization for external agent MCP fallback and startup errors in multiple languages.
- Created tests for the new event classification logic and ensured proper handling of localized error messages.
2026-09-02 16:22:23 +08:00
Kang 688bbfd615 Merge upstream main into PR #521 2026-09-02 00:49:05 +08:00
lly 5c379d61b8 feat(editor): support Ctrl+wheel font zoom in builtin file editor 2026-09-01 19:10:32 +08:00
Kang f0267a6538 feat(sftp): introduce helper functions for directory listing and stat commands
- Added `list_dir_command` and `stat_command` functions to streamline the creation of shell commands for listing directories and retrieving file statistics with numeric owner and group information.
- Updated `stat_remote_properties` and `list_dir` methods to utilize the new command functions, improving code readability and maintainability.
- Enhanced unit tests to validate the new command functions and ensure correct parsing of directory entries.
2026-09-01 14:23:59 +08:00
Kang 576d1899d5 feat(mcp): implement MCP session open request handling and permission modes
- Added support for handling MCP session open requests, including the ability to respond to session creation with success or error messages.
- Introduced new permission modes for AI interactions, including "full_access", and updated the permission handling logic to accommodate these changes.
- Refactored the AiPermissionSelect component to manage permission modes more effectively and added corresponding tests to ensure functionality.
- Updated translations for new permission modes and improved the UI to reflect changes in session handling.
2026-08-31 21:12:30 +08:00
Kang eefc93f9d7 feat(mcp): refactor Windows ACL handling and add tests for discovery functionality
- Moved Windows ACL logic from `discovery.rs` to a new `windows_acl.rs` module for better organization and maintainability.
- Implemented `set_current_user_only` function to apply current user-only ACLs for files and directories.
- Added unit tests to ensure that the discovery process preserves private ACLs and cleans up temporary files correctly.
- Updated `mod.rs` to include the new `windows_acl` module conditionally for Windows builds.
2026-08-31 17:04:20 +08:00
Kang 877a970e03 feat(interaction): implement terminal right-click action settings (#530)
- Introduced a new setting for terminal right-click actions, allowing users to choose between "none", "menu", and "paste" options.
- Updated the InteractionTab component to include a tabbed interface for selecting the right-click action.
- Refactored the TerminalContextMenu to handle the new right-click action logic, ensuring appropriate behavior based on user selection.
- Added tests for the terminal right-click action functionality to validate expected behaviors and interactions.
- Migrated legacy right-click paste settings to the new terminal right-click action configuration.
2026-08-30 21:44:01 +08:00
Kang 078e8be4f4 feat(mcp): implement active session reporting and associated hooks
- Added `useMcpActiveSession` hook to manage and report the active MCP session ID.
- Integrated the hook into the main `App` component to ensure active session updates.
- Created tests for the `useMcpActiveSession` hook to validate session reporting behavior.
- Introduced `report_mcp_active_session` command in the Tauri backend to handle session updates from the frontend.
- Updated MCP tool definitions to include new capabilities and ensure proper session management.
2026-08-30 15:14:16 +08:00
Kang 4972d80795 feat: add SFTP pipeline depth configuration (#429)
- Introduced a new setting for SFTP pipeline depth in the SshForm component, allowing users to specify the depth for single-file SFTP requests.
- Updated SftpSettings interface and backend to support the new pipeline depth option, including validation for minimum and maximum values.
- Enhanced the SFTP backend to utilize the pipeline depth setting during file transfers, improving performance and control over SFTP operations.
- Added tests to ensure correct handling of pipeline depth configurations and their effects on transfer behavior.
2026-08-30 01:21:24 +08:00
Kang 61d75beaa1 refactor: enhance SSH config import logic for multi-hop connections
- Improved handling of ProxyJump specifications to correctly link multi-hop connections.
- Updated tests to validate the behavior of direct and routed jumps, ensuring existing aliases do not block multi-hop imports.
- Refactored `jump_import_node` to manage route-specific semantics and maintain clarity in naming conventions for imported connections.
2026-08-29 12:34:56 +08:00
Kang c78d7d647a refactor: improve SSH config parsing and entry conversion
- Updated `list_ssh_config_hosts` to return entries directly.
- Enhanced `load_from` method to retain global options and handle ProxyJump specifications more robustly.
- Refactored `to_entries` method to return an `AppResult` for better error handling.
- Introduced `ParseState` struct to manage parsing state and improve clarity in the parsing logic.
- Adjusted parsing functions to align with OpenSSH behavior for relative includes and global options.
2026-08-29 12:18:59 +08:00
Joel Claw a58fdd8a21 fix: address Codex review feedback on SSH config PR
- Parse user@host:port in ProxyJump specs (P2)
- Deduplicate concrete aliases in list_hosts (P2)
- Retain global options declared before first Host block (P2)
- Fix resolve_first_match_wins test expectation (P1)
- Wire full ProxyJump chain in import (all hops, not just first) (P1)
- ProxyJump user@host:port specs parsed for jump host matching (P2)
- Localization already done (sshConfigSource in all 4 locales)
- Cargo.lock already has whoami entry
2026-08-29 11:15:25 +08:00
Joel Claw 216df04ace fix: address Codex review feedback on PR #504
- P1: Add whoami 1.5.2 to Cargo.lock (was missing, breaks --locked builds)
- P1: Fix auth mode from invalid 'publicKey' to valid 'agent' for imported
  connections with IdentityFile (key files need manual registration in
  nyaterm's key store; identity path noted in description)
- P1: Wire ProxyJump relationships during import - jump hosts imported
  first, their IDs linked via ConnectionNetwork.proxy_jump_id on targets
- P1: Localize SSH Config source label in all 4 locale files
  (en, zh-CN, zh-TW, ko) per AGENTS.md L115-L119
- P2: Fix relative Include resolution - base_dir now derived from
  config_path.parent() (~/.ssh/) instead of config_path itself
- Remove unused ConnectionNetwork import
- Add newline at EOF in cmd/ssh_config.rs
- Add test for relative include base_dir derivation
2026-08-29 11:15:25 +08:00
Joel Claw ece922baa3 feat: SSH config import with ProxyJump support
Add ability to import sessions from ~/.ssh/config into nyaterm.

Backend (Rust):
- New core/ssh_config module: parses OpenSSH config with Host patterns
  (wildcards, negation), HostName, Port, User, IdentityFile, ProxyJump
  (single and multi-hop chains), HostKeyAlias, and Include directives
  (recursive with cycle detection and glob support)
- First-match-wins option resolution matching OpenSSH semantics
- New cmd/ssh_config module with 4 Tauri commands: list_ssh_config_hosts,
  get_ssh_config, resolve_ssh_host, import_ssh_config_hosts
- Import skips duplicates by name, creates SavedConnection entries
  with proper ConnectionType::Ssh config
- 5 unit tests covering glob matching, negation, proxy jump chains,
  first-match-wins, and wildcard filtering

Frontend (React/TypeScript):
- New 'SSH Config' source in ImportDialog (no file picker needed,
  reads ~/.ssh/config directly)
- New types: SshConfigEntry, SshConfigHop in global.d.ts
- Import flow: click SSH Config in import dialog, all concrete hosts
  are imported as saved connections, duplicates skipped

Example ~/.ssh/config:
  Host bastion
      HostName bastion.example.com
      User jumpuser

  Host internal-db
      HostName 10.0.0.42
      User admin
      ProxyJump bastion
      IdentityFile ~/.ssh/db_key

  Host deep-server
      HostName 192.168.5.100
      User root
      ProxyJump bastion,internal-gateway

Wildcard patterns (web-*) are excluded. Only concrete host aliases
are imported. No real server data transmitted, reads local file only.
2026-08-29 11:15:25 +08:00
Kang ccf69d826e feat(file-explorer): add symlink target management in PropertiesDialog
- Enhanced the PropertiesDialog component to support editing symlink targets for remote files.
- Introduced a new state for symlink targets and updated the UI to include an input field for this attribute.
- Implemented validation to ensure symlink targets are provided when editing symlink properties.
- Updated the backend to handle symlink target updates, including new commands for remote symlink management.
- Adjusted file properties handling to include symlink target information in both local and remote contexts.
2026-08-29 10:54:11 +08:00
mengshouer 1d18807b8e feat: add dynamic terminal tab titles 2026-08-29 02:28:53 +08:00
Kang 3be20a6bb0 feat(mcp): MCP (#226)
- Added the McpApprovalHost component to handle external MCP approval requests, enhancing user interaction with external tools.
- Updated the App component to include the McpApprovalHost, ensuring it is rendered within the application layout.
- Introduced external MCP settings in the AiTab component, allowing users to configure MCP options such as enabling/disabling and permission modes.
- Implemented state management for MCP runtime status and client configurations, improving the overall functionality and user experience.
- Added default settings for external MCP in the AI settings module, ensuring a consistent initial configuration.
2026-08-27 23:35:51 +08:00
Kang 5c3a24a320 perf(terminal): implement OutputAckCoordinator for managing output acknowledgments
- Introduced the OutputAckCoordinator class to handle acknowledgment of output bytes in terminal sessions, allowing for better management of session state and error handling.
- Added comprehensive unit tests to validate the functionality of the OutputAckCoordinator, including scenarios for ACK handling, failure requeuing, and backoff strategies.
- Updated XTerminal and xterminalOutputController to integrate the new OutputAckCoordinator, enhancing output management capabilities.
- Refactored session command handling to utilize session_command_channel for improved command processing.
2026-08-27 19:30:52 +08:00
Kang ff0fad925c refactor(security): replace screen lock with separate startup and idle lock settings
- Updated security settings to introduce distinct options for enabling startup and idle locks, replacing the previous combined screen lock setting.
- Modified relevant components and contexts to accommodate the new settings structure.
- Implemented migration logic to transition from the legacy screen lock to the new settings, ensuring backward compatibility.
- Enhanced user interface to reflect the changes in security options.
2026-08-27 11:50:54 +08:00
Kang f65b0b8a50 perf(terminal): refactor event listener management and introduce async unlisten bag (#486)
- Replaced the previous unlistener array with an `asyncUnlistenBag` for better management of event listeners in the XTerminal component.
- Updated the setup of wake listeners to utilize the new unlisten bag, improving code clarity and efficiency.
- Added a new utility for handling asynchronous unlisten operations, ensuring proper cleanup of listeners.
- Introduced tests for the async unlisten bag to validate its functionality and reliability.
2026-08-24 09:19:17 +08:00
Kang e7a2daa3fa feat(session): implement external local session handling and working directory validation (#487)
- Added `createExternalLocalSession` function to facilitate the creation of local terminal sessions with specified working directories.
- Introduced `connectExternalLocalSession` in the `App` component to manage external local session connections.
- Enhanced `extract_external_open_urls` to support local session requests with optional working directory arguments.
- Updated `create_local_session` to handle explicit working directory inputs and validate their existence before session creation.
- Added tests for local session handling, including scenarios for missing directories and explicit working directory overrides.
- Improved `LocalSessionConfig` to include a flag for handling missing working directories during session initialization.
2026-08-24 01:22:14 +08:00
Kang 7b09cfc152 feat(editor): implement file editor open mode resolution and internal editor display settings
- Added new functions `resolveFileEditorOpenTarget` and `resolveInternalEditorDisplay` to determine the appropriate editor mode based on user settings.
- Introduced a test suite for the file editor open mode to validate the new resolution logic.
- Updated the `FileExplorer` component to utilize the new editor resolution functions, enhancing file handling capabilities.
- Modified the `TransferTab` and context providers to include `internal_editor_display` settings, defaulting to "workspace".
- Enhanced type definitions to support the new editor settings and ensure type safety across components.
2026-08-24 01:14:10 +08:00
Kang 16247d0581 feat(floating-panels): implement floating panel functionality and state management (#448)
- Introduced a new `FloatingPanel` component to support left and right floating panels, enhancing the user interface for better panel management.
- Added state management for floating panels in the `App` component, allowing users to open, close, and move panels between sides.
- Implemented logic to handle panel open modes, enabling users to switch between docked and floating modes seamlessly.
- Updated the `ActivityBar` and `AppLayout` components to integrate floating panel features, including context menu options for toggling panel modes.
- Enhanced tests to cover new floating panel functionalities and ensure robust behavior across different scenarios.
2026-08-24 00:27:05 +08:00
Kang f54597f049 feat(activity-bar): enhance activity bar management with reset and visibility features
- Introduced new components for managing activity bar overlays, including `ActivityBarResetDialog` and `AppOverlayDialogs`.
- Added functionality to hide and show activity bar items, improving user control over the interface.
- Implemented reset layout functionality for the activity bar, allowing users to restore default settings.
- Updated the `ActivityBar` component to support hidden items and context menu interactions for better usability.
- Refactored related hooks and context providers to manage activity bar state effectively.
- Enhanced tests to cover new features and ensure robust functionality.
2026-08-23 23:22:35 +08:00
Kang b2b33a1d08 feat(ssh): introduce SSH runtime mode handling in connection management (#410)
- Added support for SSH runtime modes ("standard" and "terminal") across various components, including session creation and external connection parsing.
- Updated the `ExternalOpenIntent` and related types to include runtime mode specifications.
- Enhanced the temporary link parsing to handle runtime modes, ensuring proper configuration for SSH connections.
- Implemented tests to validate runtime mode functionality and its integration with existing features.
- Refactored relevant functions to accommodate the new runtime mode logic, improving overall connection management.
2026-08-23 22:22:56 +08:00
Kang b8715980c2 feat(custom-icons): implement custom connection icon management in the session interface (#464)
- Added functionality to import, delete, and display custom connection icons in the NewSessionPage.
- Introduced a new ConnectionCustomIcon type to manage custom icon data, including ID, name, and data URL.
- Enhanced the backend with commands to handle custom icon operations, including importing and deleting icons.
- Updated the storage layer to support custom icon persistence and retrieval.
- Implemented UI components for selecting and managing custom icons, including import and delete options.
- Added tests to ensure proper functionality of custom icon handling and migration from legacy data URLs.
2026-08-23 20:52:46 +08:00
Kang 4adc4a01b2 feat(network): integrate proxy and jump host selection in session forms (#480)
- Added a new `SessionNetworkSection` component to handle proxy and jump host configurations for RDP, SSH, and VNC session forms.
- Updated `RdpForm`, `SshForm`, and `VncForm` to include the new network section, allowing users to select proxies and jump hosts.
- Enhanced the `NewSessionPage` to support network configurations across different session types.
- Modified related tests to ensure proper functionality of the new network selection features.
2026-08-23 18:00:03 +08:00
Kang 60d993f8ec feat(rdp): enhance error classification and logging for RDP connections
- Added detailed logging for RDP TLS backend selection, improving traceability during connection setup.
- Refactored error classification functions to better categorize TLS and certificate-related errors, enhancing error handling.
- Introduced new utility functions to identify TLS errors and Nyaterm certificate rejections, streamlining error management.
- Added unit tests to validate the behavior of the new error classification logic and ensure robustness in handling various error scenarios.
2026-08-23 17:08:35 +08:00
Kang d04eff32bb feat(aiSettings): introduce API format selection for AI provider credentials (#455)
- Added support for selecting API formats in the AI settings, specifically for OpenAI and compatible providers.
- Implemented a new `supportsApiFormatSelection` function to determine if a provider allows API format selection.
- Updated the `AiProviderCredential` type to include an `api_format` field, defaulting to "chat_completions".
- Enhanced the UI to allow users to select between "chat_completions" and "responses" formats when configuring credentials.
- Updated schema version to 6 to reflect changes in the settings structure.
- Added tests to ensure proper handling of API format defaults and selection logic.
2026-08-23 16:00:15 +08:00
Kang 0f6a0bcb86 refactor(app): adjust child window focus handling for macOS (#483)
- Moved focusability settings for child windows to the macOS-specific section to ensure proper focus management during window creation.
- Removed redundant focusability settings from the initial window builder configuration, streamlining the code.
- Ensured that the child window remains unfocusable until the ready handshake is complete, preventing focus issues on macOS.
2026-08-22 10:50:01 +08:00
Kang 7236e88878 feat(aiSettings): update Ollama provider base URL and add tests for default settings (#469)
- Changed the default base URL for the Ollama provider from the v1 path to the root URL.
- Added tests to ensure the Ollama provider uses the correct base URL and migrates legacy URLs appropriately.
- Introduced helper functions to manage Ollama provider settings and ensure compatibility with legacy configurations.
2026-08-20 23:27:08 +08:00
Kang 5f6145b9e7 refactor: clean up AI component logic and improve model handling
- Removed unused model resolution logic from the AIAssistantPanel, simplifying the component's state management.
- Enhanced the handling of AI model selection by introducing a new function to resolve model names, making the code more maintainable.
- Updated the SendCommandPanel to remove unnecessary UI elements, streamlining the interface.
- Refactored various settings components for better readability and consistency in state updates.
2026-08-20 21:06:07 +08:00
Kang 32749acbf8 feat(webview): enhance support for Windows 7 WebView2 runtime
- Added conditional compilation for Windows 7 to handle WebView2 fixed runtime directory.
- Implemented logic to set the `WEBVIEW2_BROWSER_EXECUTABLE_FOLDER` environment variable if the runtime is portable and the directory exists.
- Introduced helper functions to determine the appropriate runtime directory for Windows 7, improving compatibility and user experience.
2026-08-19 18:40:59 +08:00
Kang 044e78e37d refactor(tests): rename test functions for clarity and enhance local terminal preservation logic (#470)
- Updated test function names to better reflect their purpose, specifically regarding local terminal and serial device field handling.
- Improved the logic in `strip_device_local_sessions` and `preserve_device_local_sessions` to ensure local terminal fields are preserved correctly when incoming sessions are empty.
- Added a new test to verify preservation of local terminal fields for legacy empty snapshots.
2026-08-19 16:39:53 +08:00
Kang 06c0991c71 feat(serial-send): add option to clear input after sending command 2026-08-19 00:34:06 +08:00
Kang 44129a3924 feat(zmodem): enhance upload error handling and conflict resolution
- Introduced a new function `getUploadFailureDescription` to provide user-friendly error messages for upload failures.
- Updated `failPendingZmodemUpload` to accept an options parameter for UI handling, improving error management.
- Implemented `isZmodemUploadErrorHandled` to check if upload errors have been addressed in the UI.
- Enhanced the `handleTerminalFileDrop` function to conditionally display error messages based on upload error handling.
- Added tests for Zmodem upload behavior, including handling of skipped files and overwrite conflicts.
2026-08-18 11:22:40 +08:00
Kang a9bdd97ea2 feat(terminal-session): enhance working directory handling for local and WSL commands (#460)
- Introduced a new function `apply_working_dir_to_command` to streamline the application of working directories for both local and WSL commands.
- Added an enum `WorkingDirectoryOutcome` to represent the result of applying a working directory.
- Updated the terminal session logic to utilize the new function, improving clarity and reducing code duplication.
- Added unit tests to validate the behavior of working directory handling for various scenarios, including WSL and local paths.
2026-08-17 11:26:15 +08:00