Interface: ProviderConnectionShellAccess
Callback for openning shell session
Methods
open()
Opens new session using ProviderConnectionShellAccessImpl class
Returns
ProviderConnectionShellAccessSession
Example
import * as api from '@podman-desktop/api';
class ProviderConnectionShellAccessImpl implements ProviderConnectionShellAccess {
open(): ProviderConnectionShellAccessSession {
// This is client that will connect to your shell
#client = new Client();
// You need to listen to events from client and forward them to the caller by using the object returned below
return {
onData,
onError,
onEnd,
write,
resize,
close,
};
}
}
export async function activate(extensionContext: api.ExtensionContext): Promise<void> {
const providerConnectionShellAccess = new ProviderConnectionShellAccessImpl(machineInfo);
// Create containerProviderConnection object
const containerProviderConnection: extensionApi.ContainerProviderConnection = {
...
shellAccess: providerConnectionShellAccess,
...
};
const disposable = provider.registerContainerProviderConnection(containerProviderConnection);
extensionContext.subscriptions.push(disposable);
}