(
args: Readonly<{
scenarioId: string;
capabilityProfile: ScenarioCapabilityProfile;
env?: EnvMap;
}>,
)
| 91 | } |
| 92 | |
| 93 | export function buildPtyTargetEnv( |
| 94 | args: Readonly<{ |
| 95 | scenarioId: string; |
| 96 | capabilityProfile: ScenarioCapabilityProfile; |
| 97 | env?: EnvMap; |
| 98 | }>, |
| 99 | ): EnvMap { |
| 100 | const colorEnv = termEnvForColorMode(args.capabilityProfile.colorMode); |
| 101 | return Object.freeze({ |
| 102 | ...(args.env ?? {}), |
| 103 | ...colorEnv, |
| 104 | [PTY_TARGET_CAP_MOUSE_ENV]: args.capabilityProfile.supportsMouse ? "1" : "0", |
| 105 | [PTY_TARGET_CAP_BRACKETED_PASTE_ENV]: args.capabilityProfile.supportsBracketedPaste ? "1" : "0", |
| 106 | [PTY_TARGET_CAP_FOCUS_EVENTS_ENV]: args.capabilityProfile.supportsFocusEvents ? "1" : "0", |
| 107 | [PTY_TARGET_CAP_OSC52_ENV]: args.capabilityProfile.supportsOsc52 ? "1" : "0", |
| 108 | [PTY_TARGET_SCENARIO_ID_ENV]: args.scenarioId, |
| 109 | [PTY_TARGET_NATIVE_CONFIG_ENV]: JSON.stringify( |
| 110 | nativeConfigForCapabilities(args.capabilityProfile), |
| 111 | ), |
| 112 | }); |
| 113 | } |
| 114 | |
| 115 | export function parsePtyTargetScenarioId(env: EnvMap = process.env as EnvMap): string { |
| 116 | const raw = env[PTY_TARGET_SCENARIO_ID_ENV]; |
no test coverage detected