summaryrefslogtreecommitdiff
path: root/source/prompt/ps1.d
diff options
context:
space:
mode:
authorShav Kinderlehrer <[email protected]>2023-08-09 16:01:15 -0400
committerShav Kinderlehrer <[email protected]>2023-08-09 16:01:15 -0400
commit85f830ce4730da0489bc14d8726de7fb2dd0fc38 (patch)
tree811707c736ce7098b5655f018219c5093518f0a0 /source/prompt/ps1.d
parent24c94e510ab9c016542b287e060c992c195d7987 (diff)
downloadprim-85f830ce4730da0489bc14d8726de7fb2dd0fc38.tar.gz
prim-85f830ce4730da0489bc14d8726de7fb2dd0fc38.zip
Add styles
Diffstat (limited to 'source/prompt/ps1.d')
-rw-r--r--source/prompt/ps1.d17
1 files changed, 14 insertions, 3 deletions
diff --git a/source/prompt/ps1.d b/source/prompt/ps1.d
index 9bf8021..5b8bafa 100644
--- a/source/prompt/ps1.d
+++ b/source/prompt/ps1.d
@@ -1,14 +1,25 @@
module prompt.ps1;
+import std.conv;
+
+import prim.opt;
import comp.hr;
+
+import style;
import style.color;
+import style.font;
-string ps1(int col) {
+string ps1(Opts opt) {
string ps;
- ps ~= hr(col);
+ // divider
+ ps ~= hr(opt.col).set(Color.black);
+
+ // previous command status
+ ps ~= ("(" ~ to!string(opt.status) ~ ") ").set(Color.black);
- ps ~= "> ".setColor(Color.magenta);
+ // prompt char
+ ps ~= "|> ".set(Font.bold).set(opt.status == 0 ? Color.green : Color.red);
return ps;
}