Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(shell): preserve literal carriage returns in captured values #35702

OpenLucenx9(GitHub profile, opens in a new tab)wants to merge 2 commits intomain fromrefs/pull/35702/headopened View on GitHub

Showing 3 changed files with 29 additions and 49 deletions.

x
0 of 3 viewed, 3 left
3 additions and 25 deletionsapps/desktop/src/shell/DesktopShellEnvironment.tsModified
View file
@@ -2,6 +2,7 @@
import {
applyShellEnvironment,
buildEnvironmentCaptureCommand,
+ extractEnvironmentValues,
listLoginShellCandidates,
readUserLoginShell,
setWindowsPath,
@@ -233,29 +234,6 @@
}),
].join("; ");
​
-const extractEnvironment = (output: string, names: ReadonlyArray<string>): EnvironmentPatch => {
- const environment: EnvironmentPatch = {};
-​
- for (const name of names) {
- const start = output.indexOf(startMarker(name));
- if (start === -1) continue;
-​
- const valueStart = start + startMarker(name).length;
- const end = output.indexOf(endMarker(name), valueStart);
- if (end === -1) continue;
-​
- const value = output
- .slice(valueStart, end)
- .replace(/^\r?\n/, "")
- .replace(/\r?\n$/, "");
- if (value.length > 0) {
- environment[name] = value;