Commit 7abf57f8 authored by Antonio Rojas's avatar Antonio Rojas
Browse files

Fix unusable Sage session after a syntax error

When we are thrown to the additional input prompt, simply report and error and send an interrupt signal to exit.

Do not try to guess what the problem is and fix it: this might be caused by an unmatched opening bracket or closing bracket, in which case we would be stuck in the additional input prompt forever

BUG: 429078
parent 0c46c2b6
...@@ -143,8 +143,8 @@ void SageExpression::parseOutput(const QString& text) ...@@ -143,8 +143,8 @@ void SageExpression::parseOutput(const QString& text)
//interrupt it and show an error message //interrupt it and show an error message
if(endsWithAlternativePrompt) if(endsWithAlternativePrompt)
{ {
// Exit from sage additional input mode by closing the bracket // Exit from sage additional input mode
static_cast<SageSession*>(session())->sendInputToProcess(QLatin1String(")\n")); static_cast<SageSession*>(session())->sendInputToProcess(QLatin1String("\x03"));
m_syntaxError = true; m_syntaxError = true;
} }
else else
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment