mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Allow to define the path of the shell in app preferences
Signed-off-by: Lauri Nevala <lauri.nevala@gmail.com>
This commit is contained in:
parent
9f15bb9626
commit
f9639f0884
@ -20,6 +20,7 @@ export interface UserStoreModel {
|
||||
|
||||
export interface UserPreferences {
|
||||
httpsProxy?: string;
|
||||
shell?: string;
|
||||
colorTheme?: string;
|
||||
allowUntrustedCAs?: boolean;
|
||||
allowTelemetry?: boolean;
|
||||
|
||||
@ -105,13 +105,14 @@ export class ShellSession extends EventEmitter {
|
||||
protected async getShellEnv() {
|
||||
const env = JSON.parse(JSON.stringify(await shellEnv()));
|
||||
const pathStr = [this.kubectlBinDir, this.helmBinDir, process.env.PATH].join(path.delimiter);
|
||||
const shell = userStore.preferences.shell && userStore.preferences.shell !== "" ? userStore.preferences.shell : process.env.SHELL;
|
||||
|
||||
if(isWindows) {
|
||||
env["SystemRoot"] = process.env.SystemRoot;
|
||||
env["PTYSHELL"] = process.env.SHELL || "powershell.exe";
|
||||
env["PTYSHELL"] = shell || "powershell.exe";
|
||||
env["PATH"] = pathStr;
|
||||
} else if(typeof(process.env.SHELL) != "undefined") {
|
||||
env["PTYSHELL"] = process.env.SHELL;
|
||||
} else if(typeof(shell) != "undefined") {
|
||||
env["PTYSHELL"] = shell;
|
||||
env["PATH"] = pathStr;
|
||||
} else {
|
||||
env["PTYSHELL"] = ""; // blank runs the system default shell
|
||||
|
||||
@ -25,6 +25,7 @@ export class Preferences extends React.Component {
|
||||
@observable helmRepos: HelmRepo[] = [];
|
||||
@observable helmAddedRepos = observable.map<string, HelmRepo>();
|
||||
@observable httpProxy = userStore.preferences.httpsProxy || "";
|
||||
@observable shell = userStore.preferences.shell || "";
|
||||
|
||||
@computed get themeOptions(): SelectOption<string>[] {
|
||||
return themeStore.themes.map(theme => ({
|
||||
@ -130,7 +131,17 @@ export class Preferences extends React.Component {
|
||||
<small className="hint">
|
||||
Proxy is used only for non-cluster communication.
|
||||
</small>
|
||||
|
||||
<h2>Terminal Shell</h2>
|
||||
<Input
|
||||
theme="round-black"
|
||||
placeholder={process.env.SHELL}
|
||||
value={this.shell}
|
||||
onChange={v => this.shell = v}
|
||||
onBlur={() => preferences.shell = this.shell}
|
||||
/>
|
||||
<small className="hint">
|
||||
The path of the shell that the terminal uses.
|
||||
</small>
|
||||
<KubectlBinaries preferences={preferences}/>
|
||||
|
||||
<h2>Helm</h2>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user