mirror of
https://github.com/1Remote/1Remote.git
synced 2026-04-25 13:36:03 +03:00
[PR #1012] [CLOSED] Fix process access exception in integrated SSH/SFTP connections #3863
Labels
No labels
area-configuration
area-ct-app
area-ct-rdp
area-ct-remoteapp
area-ct-ssh
area-ct-vnc
area-launcher
area-list
area-tags
area-teamwork
bug
chore
dependencies
general-build/ci
general-performance
general-refactor
general-security
general-supportive
general-ux
meta-documentation
meta-enhancement
meta-enhancement
meta-feature
meta-help-wanted
meta-unknown-error
priority-hi
priority-low
pull-request
question
resolution-duplicate
resolution-invalid
resolution-wontfix
stale
task-put-off
task-still-considering
task-working-in-progress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/1Remote#3863
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/1Remote/1Remote/pull/1012
Author: @Copilot
Created: 10/21/2025
Status: ❌ Closed
Base:
main← Head:copilot/fix-ssh-sftp-crash📝 Commits (2)
a2c9994Initial plan1ca7f75Add exception handling for process MainWindowHandle access in timer callback📊 Changes
1 file changed (+20 additions, -6 deletions)
View changed files
📝
Ui/View/Host/ProtocolHosts/IntegrateHost.xaml.cs(+20 -6)📄 Description
Problem
Users were experiencing crashes with the error message "没有与此对象关联的进程" (No process is associated with this object) when launching SSH connections with SFTP in integrated window mode. The application would become unresponsive and display a fatal error dialog.
The issue occurred when:
Process.MainWindowHandlepropertyInvalidOperationExceptionbecause the process has already exitedStack trace from the error:
Root Cause
In
IntegrateHost.xaml.cs, theStart()method creates a timer that runs every 100ms for up to 10 seconds to detect the main window handle of the integrated process. This timer callback accessed_process.MainWindowHandlewithout exception handling, causing a crash when the process exited before the timer stopped.Solution
Added comprehensive exception handling to the timer callback that detects MainWindowHandle:
This change:
InvalidOperationExceptionwhen process has exitedGetHostHwnd()methodTesting
Related
This complements the existing fix in
GetHostHwnd()(lines 536-551) which already has similar protection. Together, these changes provide comprehensive protection against process access exceptions in integrated connections.Fixes the crash reported in the issue where users on Windows 11 (build 26200) with version 1.1.2 experienced application freezes when using SSH/SFTP with integrated windows.
Original prompt
This section details on the original issue you should resolve
<issue_title>没有与此对象关联的进程。</issue_title>
<issue_description>Describe the bug
Crash
To Reproduce
Steps to reproduce the behavior:
Launching a SSH Connect with SFTP.
Expected behavior
Can't interact with program windows.
Screenshots

Desktop (please complete the following information):
OS:
-- 版本 Windows 11 专业版
-- 版本号 25H2
-- 安装日期 2025/10/4
-- 操作系统版本 26200.6899
-- 体验 Windows 功能体验包 1000.26100.253.0
PRemoteM Version [1.1.2(Built at: 2025-03-22T09:09:47.586+08:00)`(Microsoft store)]
Additional context
Environment
1.1.2(Built at: 2025-03-22T09:09:47.586+08:00)(Microsoft store).NET Framework 4.84.0.30319.42000Windows 10 Pro 64-bits 10.0.26200.0 (2009) build 26200Error Info
没有与此对象关联的进程。
Stack Trace
Recent Log