diff mercurial/patch.py @ 42566:f802a75da585

patch: use a short, fixed-size message for last line of prompt (issue6158) See issue6158 and the previous commit for examples of what might go wrong if we have some combinations of readline version and terminal and need to wrap the line. Briefly: readline may not display the beginning of the last line of the prompt, or it may print over it with the end of the prompt, making it difficult for users to know what's going on. Differential Revision: https://phab.mercurial-scm.org/D6563
author Kyle Lippincott <spectral@google.com>
date Thu, 20 Jun 2019 14:45:52 -0700
parents db72f9f6580e
children 1fd530b1e1cf
line wrap: on
line diff
--- a/mercurial/patch.py	Thu Jun 20 11:40:47 2019 -0700
+++ b/mercurial/patch.py	Thu Jun 20 14:45:52 2019 -0700
@@ -1089,7 +1089,9 @@
             return skipfile, skipfile, skipall, newpatches
         while True:
             resps = messages['help'][operation]
-            r = ui.promptchoice("%s %s" % (query, resps))
+            # IMPORTANT: keep the last line of this prompt short (<40 english
+            # chars is a good target) because of issue6158.
+            r = ui.promptchoice("%s\n(enter ? for help) %s" % (query, resps))
             ui.write("\n")
             if r == 8: # ?
                 for c, t in ui.extractchoices(resps)[1]: