Open TylerLeonhardt opened 3 weeks ago
UInt8Array was cumbersome to pass across processes... so I landed on a base64 string. From there, an extension (Microsoft auth) can simply turn that into a Buffer Buffer.from(env.handle, 'base64')
and pass it through.
New proposal:
export namespace env {
/**
* Retrieves a base64 representation of a native window
* handle of the current window.
*/
export const handle: string | undefined;
}
Let's keep this open to track lifecyle of this proposal
handle
on env
feels weird. Couple ideas:
window.handle
env.windowHandle
I believe window.handle
is the most correct but maybe a more telling name, like nativeHandle
or so?
what about AUX windows?
New proposal:
declare module 'vscode' {
export namespace window {
/**
* Retrieves the native window handle of the current active window.
* This will be updated when the active window changes.
*/
export const nativeHandle: Uint8Array | undefined;
}
}
For Broker support in Microsoft Authentication (https://github.com/microsoft/vscode/issues/229431) we need the window handle for this API: https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-node/docs/brokering.md#window-parenting
So, I need to be able to access the window handle from Main alllll the way in an extension.
Here's the proposal: