[console] Prepend introductory text with '#' to avoid attempting to format it as Python code

This commit is contained in:
Nyall Dawson 2021-03-30 09:08:31 +10:00
parent 18d8a76009
commit 0f54df6675

View File

@ -141,6 +141,8 @@ class ShellOutputScintilla(QgsCodeEditorPython):
"Use iface to access QGIS API interface or type help(iface) for more info\n"
"Security warning: typing commands from an untrusted source can harm your computer")
txtInit = '\n'.join(['# ' + line for line in txtInit.split('\n')])
# some translation string for the console header ends without '\n'
# and the first command in console will be appended at the header text.
# The following code add a '\n' at the end of the string if not present.