Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[console] Prepend introductory text with '#' to avoid attempting to f…
…ormat it as Python code
  • Loading branch information
nyalldawson committed Mar 30, 2021
1 parent 18d8a76 commit 0f54df6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions python/console/console_output.py
Expand Up @@ -141,6 +141,8 @@ def insertInitText(self):
"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.
Expand Down

0 comments on commit 0f54df6

Please sign in to comment.