-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Adjust style="" to do the right thing. and squelch "set:raw" error in trying set PygmentsStyle * Add gif for prompt-toolkit. Revise GNU gif.
- Loading branch information
Showing
9 changed files
with
183 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright (C) 2020-2022, 2024 Rocky Bernstein <[email protected]> | ||
# Copyright (C) 2020-2022, 2024, 2025 Rocky Bernstein <[email protected]> | ||
|
||
from columnize import columnize | ||
|
||
|
@@ -67,7 +67,7 @@ | |
SymbolPygmentsStylesAvailable = Symbol("Settings`PygmentsStylesAvailable") | ||
|
||
|
||
def is_pygments_style(style: str): | ||
def is_pygments_style(style: str) -> bool: | ||
if style not in ALL_PYGMENTS_STYLES: | ||
print(f"Pygments style name '{style}' not found.") | ||
print(f"Style names are:\n{columnize(ALL_PYGMENTS_STYLES)}") | ||
|
@@ -154,7 +154,7 @@ def __init__( | |
) | ||
|
||
def change_pygments_style(self, style: str): | ||
if style == self.pygments_style: | ||
if not style or style == self.pygments_style: | ||
return False | ||
if is_pygments_style(style): | ||
self.terminal_formatter = Terminal256Formatter(style=style) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Large diffs are not rendered by default.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,51 @@ | ||
{"version": 2, "width": 93, "height": 37, "timestamp": 1603631223, "env": {"SHELL": "/bin/bash", "TERM": "xterm-256color"}} | ||
[0.005791, "o", "\u001b[33m$ \u001b[0m"] | ||
[0.502157, "o", "math"] | ||
[1.062212, "o", "ics"] | ||
[1.502028, "o", "script"] | ||
[2.034574, "o", "\r\n"] | ||
[2.82522, "o", "\r\nMathicsscript: 8.0.0, Mathics 8.0.0\r\non CPython 3.12.8 (main, Dec 9 2024, 11:38:23) [GCC 13.2.0]\r\nusing SymPy 1.13.3, mpmath 1.130, cython 3.0.11\r\n\r\nCopyright (C) 2011-2025 The Mathics Team.\r\nThis program comes with ABSOLUTELY NO WARRANTY.\r\nThis is free software, and you are welcome to redistribute it\r\nunder certain conditions.\r\nSee the documentation for the full license.\r\n\r\nQuit by pressing CONTROL-D\r\n\r\n"] | ||
[2.825361, "o", "\u001b[32mIn[\u001b[1m1\u001b[22m]:= \u001b[39m"] | ||
[3.695122, "o", "I"] | ||
[3.967145, "o", "n"] | ||
[4.726812, "o", "t"] | ||
[5.007269, "o", "e"] | ||
[5.335371, "o", "g"] | ||
[6.12223, "o", "\u0007"] | ||
[6.815785, "o", "\r\nInteger IntegerExponent IntegerQ IntegerString Integrate\r\nIntegerDigits IntegerLength IntegerReverse Integers \r\n\u001b[32mIn[\u001b[1m1\u001b[22m]:= \u001b[39mInteg"] | ||
[6.871228, "o", "r"] | ||
[7.000000, "o", "\u0007"] | ||
[7.520555, "o", "ate"] | ||
[7.675848, "o", "["] | ||
[8.031685, "o", "Sin["] | ||
[9.656405, "o", "θ"] | ||
[10.25736, "o", "]"] | ||
[10.817809, "o", ", "] | ||
[11.01777, "o", "{"] | ||
[11.737943, "o", "\\"] | ||
[11.773814, "o", "["] | ||
[11.961852, "o", "The"] | ||
[12.458474, "o", "\u0007"] | ||
[13.386332, "o", "ta"] | ||
[13.562337, "o", ", "] | ||
[14.130843, "o", "0"] | ||
[14.426842, "o", ", 1"] | ||
[15.090745, "o", "}]"] | ||
[15.555296, "o", "\r\n"] | ||
[15.632594, "o", "\u001b[31mOut[\u001b[1m1\u001b[22m]= \u001b[39m\u001b[38;5;208m1\u001b[39m\u001b[38;5;7m \u001b[39m\u001b[38;5;79m-\u001b[39m\u001b[38;5;7m \u001b[39m\u001b[38;5;7mCos\u001b[39m\u001b[38;5;7m[\u001b[39m\u001b[38;5;208m1\u001b[39m\u001b[38;5;7m]\u001b[39m\r\n\r\n"] | ||
[16.032643, "o", "\u001b[32mIn[\u001b[1m2\u001b[22m]:= \u001b[39m"] | ||
[17.028024, "o", "N[%]"] | ||
[17.435874, "o", "\r\n"] | ||
[17.443821, "o", "\u001b[31mOut[\u001b[1m2\u001b[22m]= \u001b[39m\u001b[38;5;208m0.459698\u001b[39m\r\n\r\n"] | ||
[17.443857, "o", "\u001b[32mIn[\u001b[1m3\u001b[22m]:= \u001b[39m"] | ||
[17.436374, "o", "N[%]"] | ||
[18.988696, "o", "\b\b\b\bIntegrate[Sin[θ], {θ, 0, 1}]"] | ||
[19.11296, "o", "\b\u001b[K"] | ||
[19.445726, "o", "\r\u001b[C\u001b[C\u001b[C\u001b[C\u001b[C\u001b[C\u001b[C\u001b[C\u001b[K"] | ||
[20.533847, "o", "Integrate[Sin[θ], {\\[Theta], 0, 1}]"] | ||
[20.845902, "o", "\b"] | ||
[21.069995, "o", "\b"] | ||
[21.222015, "o", "\b"] | ||
[22.846123, "o", "P1}]\b\b\b"] | ||
[23.278141, "o", "i1}]\b\b\b"] | ||
[23.629824, "o", "\u001b[1P}]\b\b"] | ||
[24.533706, "o", "\u001b[C\u001b[C"] | ||
[25.318366, "o", "\r\n"] | ||
[25.337909, "o", "\u001b[31mOut[\u001b[1m3\u001b[22m]= \u001b[39m\u001b[38;5;208m2\u001b[39m\r\n\r\n"] | ||
[25.337952, "o", "\u001b[32mIn[\u001b[1m4\u001b[22m]:= \u001b[39m"] | ||
[26.477806, "o", "\r\n\r\nGoodbye!\r\n\r\n"] | ||
[26.480035, "o", "\u001b[0m"] | ||
{"version": 2, "width": 80, "height": 24, "timestamp": 1738279347, "env": {"SHELL": "/bin/bash", "TERM": "xterm-256color"}} | ||
[0.004157, "o", "\u001b[?2004h\u001b[33m$ \u001b[0m"] | ||
[1.358551, "o", "\u001b[H\u001b[2J\u001b[33m$ \u001b[0m"] | ||
[1.798216, "o", "mathicsscript --readline GNU"] | ||
[2.773018, "o", "\r\n\u001b[?2004l\r"] | ||
[3.447708, "o", "\r\nMathicscript: 8.0.0, Mathics 8.0.0\r\non CPython 3.12.8 (main, Dec 9 2024, 11:38:23) [GCC 13.2.0]\r\n\r\nUsing:\r\nSymPy 1.13.3, mpmath 1.3.0, numpy 1.26.4\r\ncython 3.0.11, matplotlib 3.9.3,\r\nAsymptote version 2.95\r\n\r\nCopyright (C) 2011-2025 The Mathics3 Team.\r\nThis program comes with ABSOLUTELY NO WARRANTY.\r\nThis is free software, and you are welcome to redistribute it\r\nunder certain conditions.\r\nSee the documentation for the full license.\r\n\r\nQuit by evaluating Quit[] or by pressing CONTROL-D.\r\n\r\n"] | ||
[3.447822, "o", "\u001b[32mIn[\u001b[1m1\u001b[22m]:= \u001b[39m"] | ||
[5.680936, "o", "I"] | ||
[6.08154, "o", "n"] | ||
[6.537755, "o", "t"] | ||
[7.009703, "o", "e"] | ||
[8.050647, "o", "g"] | ||
[8.703203, "o", "\u0007"] | ||
[9.172915, "o", "\r\nInteger IntegerLength IntegerQ Integers\r\nIntegerDigits IntegerPart IntegerReverse Integrate\r\nIntegerExponent IntegerPartitions IntegerString \r\n\u001b[32mIn[\u001b[1m1\u001b[22m]:= \u001b[39mInteg"] | ||
[10.30575, "o", "r"] | ||
[11.091369, "o", "ate"] | ||
[12.09041, "o", "["] | ||
[14.5699, "o", "S"] | ||
[14.856797, "o", "i"] | ||
[15.05787, "o", "n"] | ||
[15.321605, "o", "["] | ||
[16.514906, "o", "θ̣"] | ||
[16.977232, "o", "]"] | ||
[17.354395, "o", ","] | ||
[17.448072, "o", " "] | ||
[18.06578, "o", "{"] | ||
[22.489797, "o", "θ̣"] | ||
[23.102821, "o", ","] | ||
[23.175574, "o", " "] | ||
[23.455224, "o", "0"] | ||
[23.697182, "o", ","] | ||
[23.776832, "o", " "] | ||
[24.353501, "o", "1"] | ||
[24.89733, "o", "}"] | ||
[25.263849, "o", "]"] | ||
[28.497772, "o", "\r\n"] | ||
[30.567943, "o", "\u001b[31mOut[\u001b[1m1\u001b[22m]\u001b[39m= \u001b[38;5;57;01m1\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[38;5;236m-\u001b[39m\u001b[38;5;250m \u001b[39m\u001b[38;5;25;01mCos\u001b[39;00m[\u001b[38;5;57;01m1\u001b[39;00m]\r\n\r\n\u001b[32mIn[\u001b[1m2\u001b[22m]:= \u001b[39m"] | ||
[33.001598, "o", "%"] | ||
[33.880615, "o", " "] | ||
[34.194293, "o", "/"] | ||
[34.366569, "o", "/"] | ||
[34.435965, "o", " "] | ||
[34.421543, "o", "N"] | ||
[35.819642, "o", "\r\n"] | ||
[35.83116, "o", "\u001b[31mOut[\u001b[1m2\u001b[22m]\u001b[39m= \u001b[38;5;57;01m0.459698\u001b[39;00m\r\n\r\n"] | ||
[35.831283, "o", "\u001b[32mIn[\u001b[1m3\u001b[22m]:= \u001b[39m"] | ||
[36.001598, "o", "Quit[]"] | ||
[36.819642, "o", "\r\n"] | ||
[37.713122, "o", "\r\n\r\nGoodbye!\r\n\r\n"] | ||
[37.714901, "o", "\u001b[0m"] | ||
[38.073713, "o", "\u001b[?2004l\r\r\n"] |
Binary file not shown.