MCPcopy Create free account
hub / github.com/RtlZeroMemory/Rezi / buildPtyTargetEnv

Function buildPtyTargetEnv

packages/node/src/testing/ptyTargetConfig.ts:93–113  ·  view source on GitHub ↗
(
  args: Readonly<{
    scenarioId: string;
    capabilityProfile: ScenarioCapabilityProfile;
    env?: EnvMap;
  }>,
)

Source from the content-addressed store, hash-verified

91}
92
93export 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
115export function parsePtyTargetScenarioId(env: EnvMap = process.env as EnvMap): string {
116 const raw = env[PTY_TARGET_SCENARIO_ID_ENV];

Callers 2

runPtyScenarioFunction · 0.85

Calls 2

termEnvForColorModeFunction · 0.85

Tested by

no test coverage detected