diff --git a/mercurial/ui.py b/mercurial/ui.py
--- a/mercurial/ui.py
+++ b/mercurial/ui.py
@@ -1449,6 +1449,15 @@
             except Exception:
                 usereadline = False
 
+        prompt_lastline = prompt.split(pycompat.oslinesep)[-1]
+        # We're using 45 instead of 40 because of a prompt that - with the
+        # ` (yn)?` suffix, is 43 chars.
+        if len(prompt_lastline) > 45:
+            self.develwarn(
+                    'try to keep last line of prompt <40 chars, last line was: '
+                    '"%s" (%d chars)' % (prompt_lastline, len(prompt_lastline)),
+                    config='prompt-length')
+
         if self._colormode == 'win32' or not usereadline:
             if not promptopts:
                 promptopts = {}