Use the active state prompt as the default prompt
[mudpy.git] / mudpy / misc.py
index b4009c9..dce3ea6 100644 (file)
@@ -663,7 +663,17 @@ class User:
 
     def prompt(self):
         """"Generate and return an input prompt."""
-        return self.account.get("prompt", ">") + " "
+
+        # Start with the user's preference, if one was provided
+        prompt = self.account.get("prompt")
+
+        # If the user has not set a prompt, then immediately return the default
+        # provided for the current state
+        if not prompt:
+            return get_menu_prompt(self.state)
+
+        # Return the cooked prompt
+        return "%s " % prompt
 
     def adjust_echoing(self):
         """Adjust echoing to match state menu requirements."""