X-Git-Url: https://git.armaanb.net/?a=blobdiff_plain;f=src%2Fprompt.cpp;h=493425a9a6b03854932b0f7f2b23f67a0dad0b41;hb=d8afd601de1f0d8afe6eff61d40ff52d21d90fd8;hp=5b594983ade912ae5068b4ab2ddfd83386305559;hpb=53bdc8a2876b57840010d5708b20dca3a46bcef5;p=gen-shell.git diff --git a/src/prompt.cpp b/src/prompt.cpp index 5b59498..493425a 100644 --- a/src/prompt.cpp +++ b/src/prompt.cpp @@ -28,28 +28,17 @@ #include #include -static std::vector contextColors = { - "bold white on red", - "bold white on blue", - "bold white on green", - "bold white on magenta", - "black on cyan", - "black on yellow", - "black on white", -}; +//////////////////////////////////////////////////////////////////////////////// static std::vector contexts; - std::string composeContexts (bool pretty = false); -//////////////////////////////////////////////////////////////////////////////// int promptClear () { contexts.clear (); return 0; } -//////////////////////////////////////////////////////////////////////////////// int promptRemove () { if (contexts.size ()) @@ -59,6 +48,7 @@ int promptRemove () } //////////////////////////////////////////////////////////////////////////////// + int promptAdd (const std::string& context) { contexts.push_back (context); @@ -66,27 +56,10 @@ int promptAdd (const std::string& context) } //////////////////////////////////////////////////////////////////////////////// -std::string composeContexts (bool pretty /* = false */) -{ - std::string combined; - for (unsigned int i = 0; i < contexts.size (); i++) - if (pretty) - combined += (combined != "" ? " " : "") - + std::string ("\001") - + "\002"; - else - combined += (combined != "" ? " " : "") + contexts[i]; - - if (combined != "") - combined += ' '; - return combined; -} - -//////////////////////////////////////////////////////////////////////////////// std::string promptCompose () { - return ">>>"; + return "% "; } ////////////////////////////////////////////////////////////////////////////////