##// END OF EJS Templates
ui: write prompt text in ui.prompt(), not in ui._readline()...
Yuya Nishihara -
r35974:fd54846e default
parent child Browse files
Show More
@@ -1246,7 +1246,7 b' class ui(object):'
1246
1246
1247 return i
1247 return i
1248
1248
1249 def _readline(self, prompt=''):
1249 def _readline(self):
1250 if self._isatty(self.fin):
1250 if self._isatty(self.fin):
1251 try:
1251 try:
1252 # magically add command line editing support, where
1252 # magically add command line editing support, where
@@ -1258,11 +1258,6 b' class ui(object):'
1258 except Exception:
1258 except Exception:
1259 pass
1259 pass
1260
1260
1261 # call write() so output goes through subclassed implementation
1262 # e.g. color extension on Windows
1263 self.write(prompt, prompt=True)
1264 self.flush()
1265
1266 # prompt ' ' must exist; otherwise readline may delete entire line
1261 # prompt ' ' must exist; otherwise readline may delete entire line
1267 # - http://bugs.python.org/issue12833
1262 # - http://bugs.python.org/issue12833
1268 with self.timeblockedsection('stdio'):
1263 with self.timeblockedsection('stdio'):
@@ -1281,8 +1276,10 b' class ui(object):'
1281 if not self.interactive():
1276 if not self.interactive():
1282 self.write(msg, ' ', default or '', "\n")
1277 self.write(msg, ' ', default or '', "\n")
1283 return default
1278 return default
1279 self.write(msg, label='ui.prompt', prompt=True)
1280 self.flush()
1284 try:
1281 try:
1285 r = self._readline(self.label(msg, 'ui.prompt'))
1282 r = self._readline()
1286 if not r:
1283 if not r:
1287 r = default
1284 r = default
1288 if self.configbool('ui', 'promptecho'):
1285 if self.configbool('ui', 'promptecho'):
General Comments 0
You need to be logged in to leave comments. Login now