colorize prompt for remotes

This commit is contained in:
sawka
2022-12-29 00:06:53 -08:00
parent 9e2424567e
commit 9c95aa25d1
3 changed files with 46 additions and 2 deletions
+5 -2
View File
@@ -205,9 +205,12 @@ class Prompt extends React.Component<{rptr : RemotePtrType, festate : FeStateTyp
isRoot = true;
}
}
let className = (isRoot ? "term-bright-red" : "term-bright-green");
let colorClass = (isRoot ? "color-red" : "color-green");
if (remote && remote.remoteopts && remote.remoteopts.color) {
colorClass = "color-" + remote.remoteopts.color;
}
return (
<span className="term-bright-green">[{remoteStr}] {cwd} {isRoot ? "#" : "$"}</span>
<span className={cn("term-prompt", colorClass)}>[{remoteStr}] {cwd} {isRoot ? "#" : "$"}</span>
);
}
}
+36
View File
@@ -1248,6 +1248,42 @@ input[type=checkbox] {
color: @term-bright-red;
}
#main .term-prompt {
color: @term-bright-green;
&.color-green {
color: @term-bright-green;
}
&.color-red {
color: @term-bright-red;
}
&.color-blue {
color: @term-bright-blue;
}
&.color-yellow {
color: @term-bright-yellow;
}
&.color-magenta {
color: @term-bright-magenta;
}
&.color-cyan {
color: @term-bright-cyan;
}
&.color-white {
color: @term-bright-white;
}
&.color-orange {
color: @tab-orange;
}
}
#main .screen-tabs .screen-tab {
&.color-green {
color: @tab-black-text;
+5
View File
@@ -80,6 +80,10 @@ type ScreenWindowType = {
remove? : boolean,
};
type RemoteOptsType = {
color : string,
};
type RemoteType = {
remotetype : string,
remoteid : string,
@@ -100,6 +104,7 @@ type RemoteType = {
mshellversion : string,
needsmshellupgrade : boolean,
waitingforpassword : boolean,
remoteopts? : RemoteOptsType,
local : boolean,
remove? : boolean,
};