|
8 | 8 | import subprocess |
9 | 9 | from pathlib import Path |
10 | 10 |
|
11 | | -from mathicsscript.termshell import ( |
12 | | - ShellEscapeException, |
13 | | - TerminalShell, |
14 | | -) |
| 11 | +from mathicsscript.termshell import ShellEscapeException, TerminalShell |
15 | 12 |
|
16 | 13 | from mathicsscript.format import format_output |
17 | 14 |
|
@@ -151,7 +148,7 @@ def out(self, out): |
151 | 148 | "-e", |
152 | 149 | "--execute", |
153 | 150 | help="evaluate EXPR before processing any input files (may be given " |
154 | | - "multiple times)", |
| 151 | + "multiple times). Sets --quiet and --no-completion", |
155 | 152 | multiple=True, |
156 | 153 | required=False, |
157 | 154 | ) |
@@ -241,12 +238,12 @@ def main( |
241 | 238 |
|
242 | 239 | if execute: |
243 | 240 | for expr in execute: |
244 | | - print(shell.get_in_prompt() + expr) |
245 | 241 | evaluation = Evaluation( |
246 | 242 | shell.definitions, output=TerminalOutput(shell), format="text" |
247 | 243 | ) |
| 244 | + shell.terminal_formatter = None |
248 | 245 | result = evaluation.parse_evaluate(expr, timeout=settings.TIMEOUT) |
249 | | - shell.print_result(result) |
| 246 | + shell.print_result(result, "text") |
250 | 247 |
|
251 | 248 | # After the next release, we can remove the hasattr test. |
252 | 249 | if hasattr(evaluation, "exc_result"): |
@@ -288,7 +285,9 @@ def main( |
288 | 285 | print(f"Quit by pressing {quit_command}\n") |
289 | 286 |
|
290 | 287 | # If defined, full_form and style overwrite the predefined values. |
291 | | - definitions.set_ownvalue("Settings`$ShowFullFormInput", SymbolTrue if full_form else SymbolFalse) |
| 288 | + definitions.set_ownvalue( |
| 289 | + "Settings`$ShowFullFormInput", SymbolTrue if full_form else SymbolFalse |
| 290 | + ) |
292 | 291 |
|
293 | 292 | definitions.set_ownvalue( |
294 | 293 | "Settings`$PygmentsStyle", from_python(shell.pygments_style) |
|
0 commit comments