1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Make the USERPROFILE use on windows visible

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton 2021-11-19 16:04:51 -05:00
parent 93d2caa6ca
commit 86687f8b71
4 changed files with 8 additions and 5 deletions

View File

@ -189,7 +189,9 @@ export abstract class ShellSession {
} catch {}
}
return env.HOME;
return isWindows
? env.USERPROFILE
: env.HOME;
}
protected async openShellProcess(shell: string, args: string[], env: Record<string, string>) {

View File

@ -79,7 +79,7 @@ export function TerminalSettings({ entity }: EntitySettingViewProps) {
return (
<section>
<components.ClusterHomeDirSetting cluster={cluster} />
<components.ClusterLocalTerminalSetting cluster={cluster} />
</section>
);
}

View File

@ -30,13 +30,14 @@ import { Notifications } from "../../notifications";
import { resolveTilde } from "../../../utils";
import { Icon } from "../../icon";
import { PathPicker } from "../../path-picker";
import { isWindows } from "../../../../common/vars";
interface Props {
cluster: Cluster;
}
@observer
export class ClusterHomeDirSetting extends React.Component<Props> {
export class ClusterLocalTerminalSetting extends React.Component<Props> {
@observable directory = "";
@observable defaultNamespace = "";
@ -140,7 +141,7 @@ export class ClusterHomeDirSetting extends React.Component<Props> {
value={this.directory}
onChange={this.onChangeTerminalCWD}
onBlur={this.saveCWD}
placeholder="$HOME"
placeholder={isWindows ? "$USERPROFILE" : "$HOME"}
iconRight={
<>
{

View File

@ -20,7 +20,7 @@
*/
export * from "./cluster-accessible-namespaces";
export * from "./cluster-home-dir-setting";
export * from "./cluster-local-terminal-settings";
export * from "./cluster-kubeconfig";
export * from "./cluster-metrics-setting";
export * from "./cluster-name-setting";