@@ -13,7 +13,8 @@ type EditorDefinition = {
1313 /**
1414 * URL scheme for editors that support VS Code's remote deep links
1515 * (`<scheme>://vscode-remote/ssh-remote+<host><path>`). Only set for VS Code
16- * and forks that ship the Remote-SSH machinery.
16+ * and forks that ship the Remote-SSH machinery, plus Zed, which uses its own
17+ * `zed://ssh/<host><path>` shape.
1718 */
1819 readonly remoteScheme ?: string ;
1920} ;
@@ -49,7 +50,13 @@ export const EDITORS = [
4950 launchStyle : "goto" ,
5051 remoteScheme : "vscodium" ,
5152 } ,
52- { id : "zed" , label : "Zed" , commands : [ "zed" , "zeditor" ] , launchStyle : "direct-path" } ,
53+ {
54+ id : "zed" ,
55+ label : "Zed" ,
56+ commands : [ "zed" , "zeditor" ] ,
57+ launchStyle : "direct-path" ,
58+ remoteScheme : "zed" ,
59+ } ,
5360 { id : "antigravity" , label : "Antigravity" , commands : [ "agy" ] , launchStyle : "goto" } ,
5461 { id : "idea" , label : "IntelliJ IDEA" , commands : [ "idea" ] , launchStyle : "line-column" } ,
5562 { id : "aqua" , label : "Aqua" , commands : [ "aqua" ] , launchStyle : "line-column" } ,
@@ -95,9 +102,10 @@ export const remoteSchemeForEditor = (id: EditorId): string | undefined => {
95102} ;
96103
97104/**
98- * Builds a `<scheme>://vscode-remote/ssh-remote+<host><path>` deep link that
99- * opens `absolutePath` on `host` in the local editor over SSH. Returns
100- * undefined for editors without remote deep-link support.
105+ * Builds a `<scheme>://vscode-remote/ssh-remote+<host><path>` deep link (Zed
106+ * takes `zed://ssh/<host><path>`) that opens `absolutePath` on `host` in the
107+ * local editor over SSH. Returns undefined for editors without remote
108+ * deep-link support.
101109 */
102110export const buildRemoteOpenUrl = ( input : {
103111 readonly editor : EditorId ;
@@ -112,7 +120,10 @@ export const buildRemoteOpenUrl = (input: {
112120 const posixPath = input . absolutePath . replaceAll ( "\\" , "/" ) ;
113121 const rootedPath = posixPath . startsWith ( "/" ) ? posixPath : `/${ posixPath } ` ;
114122 const encodedPath = rootedPath . split ( "/" ) . map ( encodeURIComponent ) . join ( "/" ) ;
115- return `${ scheme } ://vscode-remote/ssh-remote+${ encodeURIComponent ( input . host ) } ${ encodedPath } ` ;
123+ const encodedHost = encodeURIComponent ( input . host ) ;
124+ return input . editor === "zed"
125+ ? `${ scheme } ://ssh/${ encodedHost } ${ encodedPath } `
126+ : `${ scheme } ://vscode-remote/ssh-remote+${ encodedHost } ${ encodedPath } ` ;
116127} ;
117128
118129/**
0 commit comments