Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite7088ff

Browse files
fix: add connection status indicator to vscode windows, windsurf,open-remote-ssh (#492)
Relates to#361.With the previous PR (Coder Connect integration), it's important that users always see this indicator, so I've added support in some extra scenarios. It already works in Cursor.Windsurf (macOS):<img width="1198" alt="image" src="https://github.com/user-attachments/assets/ab9b3ef4-5d70-436e-9503-f28734e446f6" />VS Code (Windows):![image](https://github.com/user-attachments/assets/6a322a1f-fa0f-4b75-b339-67a861550016)I've been told Windows used to have the indicator, but they must have changed the format of this one log line to not have parity with the other platforms.Windsurf (Windows):![image](https://github.com/user-attachments/assets/195ff78a-2bab-402a-90a6-66d3d752ff09)VSCodium - `jeanp413.open-remote-ssh` (Windows):![image](https://github.com/user-attachments/assets/62efee16-a7d4-4419-ab89-e42163cc0e6d)VSCodium - `jeanp413.open-remote-ssh` (macOS):<img width="1196" alt="image" src="https://github.com/user-attachments/assets/a0da8eda-367b-42dd-99e9-861e580fee3b" />
1 parent1395a5c commite7088ff

File tree

2 files changed

+29
-9
lines changed

2 files changed

+29
-9
lines changed

‎src/remote.ts‎

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import { Inbox } from "./inbox"
1919
import{SSHConfig,SSHValues,mergeSSHConfigValues}from"./sshConfig"
2020
import{computeSSHProperties,sshSupportsSetEnv}from"./sshSupport"
2121
import{Storage}from"./storage"
22-
import{AuthorityPrefix,expandPath,parseRemoteAuthority}from"./util"
22+
import{AuthorityPrefix,expandPath,findPort,parseRemoteAuthority}from"./util"
2323
import{WorkspaceMonitor}from"./workspaceMonitor"
2424

2525
exportinterfaceRemoteDetailsextendsvscode.Disposable{
@@ -793,14 +793,7 @@ export class Remote {
793793
// this to find the SSH process that is powering this connection. That SSH
794794
// process will be logging network information periodically to a file.
795795
consttext=awaitfs.readFile(logPath,"utf8")
796-
constmatches=text.match(/->socksPort(\d+)->/)
797-
if(!matches){
798-
return
799-
}
800-
if(matches.length<2){
801-
return
802-
}
803-
constport=Number.parseInt(matches[1])
796+
constport=awaitfindPort(text)
804797
if(!port){
805798
return
806799
}

‎src/util.ts‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,33 @@ export interface AuthorityParts {
1313
// they should be handled by this extension.
1414
exportconstAuthorityPrefix="coder-vscode"
1515

16+
// `ms-vscode-remote.remote-ssh`: `-> socksPort <port> ->`
17+
// `codeium.windsurf-remote-openssh`, `jeanp413.open-remote-ssh`: `=> <port>(socks) =>`
18+
// Windows `ms-vscode-remote.remote-ssh`: `between local port <port>`
19+
exportconstRemoteSSHLogPortRegex=/(?:->socksPort(\d+)->|=>(\d+)\(socks\)=>|betweenlocalport(\d+))/
20+
21+
/**
22+
* Given the contents of a Remote - SSH log file, find a port number used by the
23+
* SSH process. This is typically the socks port, but the local port works too.
24+
*
25+
* Returns null if no port is found.
26+
*/
27+
exportasyncfunctionfindPort(text:string):Promise<number|null>{
28+
constmatches=text.match(RemoteSSHLogPortRegex)
29+
if(!matches){
30+
returnnull
31+
}
32+
if(matches.length<2){
33+
returnnull
34+
}
35+
constportStr=matches[1]||matches[2]||matches[3]
36+
if(!portStr){
37+
returnnull
38+
}
39+
40+
returnNumber.parseInt(portStr)
41+
}
42+
1643
/**
1744
* Given an authority, parse into the expected parts.
1845
*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp