summaryrefslogtreecommitdiff
path: root/source/prompt/ps1.d
diff options
context:
space:
mode:
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;
}