mirror of
https://github.com/wavetermdev/waveterm.git
synced 2025-03-02 04:02:13 +01:00
add condaenv to the prompt (#355)
adding conda environment to prompt (#304)
This commit is contained in:
parent
0464cccf0a
commit
bbf471566f
@ -115,6 +115,7 @@ class Prompt extends React.Component<{ rptr: RemotePtrType; festate: Record<stri
|
||||
}
|
||||
let branchElem = null;
|
||||
let pythonElem = null;
|
||||
let condaElem = null;
|
||||
if (!isBlank(festate["PROMPTVAR_GITBRANCH"])) {
|
||||
let branchName = festate["PROMPTVAR_GITBRANCH"];
|
||||
branchElem = (
|
||||
@ -132,9 +133,17 @@ class Prompt extends React.Component<{ rptr: RemotePtrType; festate: Record<stri
|
||||
</span>
|
||||
);
|
||||
}
|
||||
if (!isBlank(festate["CONDA_DEFAULT_ENV"])) {
|
||||
let condaEnv = festate["CONDA_DEFAULT_ENV"];
|
||||
condaElem = (
|
||||
<span title="conda env" className="term-prompt-python">
|
||||
conda:({condaEnv}){" "}
|
||||
</span>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<span className={cn("term-prompt", { "term-prompt-color": this.props.color })}>
|
||||
{remoteElem} {pythonElem}
|
||||
{remoteElem} {condaElem} {pythonElem}
|
||||
{cwdElem} {branchElem} {rootIndicatorElem}
|
||||
</span>
|
||||
);
|
||||
|
@ -749,6 +749,9 @@ func FeStateFromShellState(state *packet.ShellState) map[string]string {
|
||||
if envMap["VIRTUAL_ENV"] != "" {
|
||||
rtn["VIRTUAL_ENV"] = envMap["VIRTUAL_ENV"]
|
||||
}
|
||||
if envMap["CONDA_DEFAULT_ENV"] != "" {
|
||||
rtn["CONDA_DEFAULT_ENV"] = envMap["CONDA_DEFAULT_ENV"]
|
||||
}
|
||||
for key, val := range envMap {
|
||||
if strings.HasPrefix(key, "PROMPTVAR_") && envMap[key] != "" {
|
||||
rtn[key] = val
|
||||
|
Loading…
Reference in New Issue
Block a user