Skip to content

Commit

Permalink
Merge branch 'master' of github.com:Mathics3/mathicsscript
Browse files Browse the repository at this point in the history
  • Loading branch information
rocky committed Dec 24, 2020
2 parents 3d66962 + fea6162 commit 47ae86b
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 33 deletions.
4 changes: 2 additions & 2 deletions mathicsscript/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,10 @@ def main(
# Then, it can be changed by the settings file (in WL)
# and overwritten by the command line parameter.
definitions.set_ownvalue(
"Settings`$ShowFullFormInput", from_python(1 if full_form else 0)
"Settings`$ShowFullFormInput", from_python(True if full_form else False)
)
definitions.set_ownvalue(
"Settings`$PygmentsShowTokens", from_python(1 if pygments_tokens else 0)
"Settings`$PygmentsShowTokens", from_python(True if pygments_tokens else False)
)

shell = TerminalShell(definitions, style, readline, completion, unicode)
Expand Down
26 changes: 0 additions & 26 deletions mathicsscript/inputrc
Original file line number Diff line number Diff line change
Expand Up @@ -38,30 +38,4 @@
"\escx\e": "\\[ScriptX]"
"\escy\e": "\\[ScriptY]"
"\escz\e": "\\[ScriptZ]"
"\escA\e": "\\[ScriptCapitalA]"
"\escB\e": "\\[ScriptCapitalB]"
"\escC\e": "\\[ScriptCapitalC]"
"\escD\e": "\\[ScriptCapitalD]"
"\escE\e": "\\[ScriptCapitalE]"
"\escF\e": "\\[ScriptCapitalF]"
"\escG\e": "\\[ScriptCapitalG]"
"\escH\e": "\\[ScriptCapitalH]"
"\escI\e": "\\[ScriptCapitalI]"
"\escJ\e": "\\[ScriptCapitalJ]"
"\escK\e": "\\[ScriptCapitalK]"
"\escL\e": "\\[ScriptCapitalL]"
"\escM\e": "\\[ScriptCapitalM]"
"\escN\e": "\\[ScriptCapitalN]"
"\escO\e": "\\[ScriptCapitalO]"
"\escP\e": "\\[ScriptCapitalP]"
"\escQ\e": "\\[ScriptCapitalQ]"
"\escR\e": "\\[ScriptCapitalR]"
"\escS\e": "\\[ScriptCapitalS]"
"\escT\e": "\\[ScriptCapitalT]"
"\escU\e": "\\[ScriptCapitalU]"
"\escV\e": "\\[ScriptCapitalV]"
"\escW\e": "\\[ScriptCapitalW]"
"\escX\e": "\\[ScriptCapitalX]"
"\esCy\e": "\\[ScriptCapitalY]"
"\esCz\e": "\\[ScriptCapitalZ]"
tab: complete
27 changes: 27 additions & 0 deletions mathicsscript/inputrc-no-unicode
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,30 @@ $include "inputrc"
# "\e\\phi\e": "φ" # ?
# "\e\\chi\e": "χ" # ?
# "\e\\psi\e": "ψ" # ?

"\escA\e": "\\[ScriptCapitalA]"
"\escB\e": "\\[ScriptCapitalB]"
"\escC\e": "\\[ScriptCapitalC]"
"\escD\e": "\\[ScriptCapitalD]"
"\escE\e": "\\[ScriptCapitalE]"
"\escF\e": "\\[ScriptCapitalF]"
"\escG\e": "\\[ScriptCapitalG]"
"\escH\e": "\\[ScriptCapitalH]"
"\escI\e": "\\[ScriptCapitalI]"
"\escJ\e": "\\[ScriptCapitalJ]"
"\escK\e": "\\[ScriptCapitalK]"
"\escL\e": "\\[ScriptCapitalL]"
"\escM\e": "\\[ScriptCapitalM]"
"\escN\e": "\\[ScriptCapitalN]"
"\escO\e": "\\[ScriptCapitalO]"
"\escP\e": "\\[ScriptCapitalP]"
"\escQ\e": "\\[ScriptCapitalQ]"
"\escR\e": "\\[ScriptCapitalR]"
"\escS\e": "\\[ScriptCapitalS]"
"\escT\e": "\\[ScriptCapitalT]"
"\escU\e": "\\[ScriptCapitalU]"
"\escV\e": "\\[ScriptCapitalV]"
"\escW\e": "\\[ScriptCapitalW]"
"\escX\e": "\\[ScriptCapitalX]"
"\esCy\e": "\\[ScriptCapitalY]"
"\esCz\e": "\\[ScriptCapitalZ]"
27 changes: 27 additions & 0 deletions mathicsscript/inputrc-unicode
Original file line number Diff line number Diff line change
Expand Up @@ -152,3 +152,30 @@ $include "inputrc"
"\e&&\e": "∧"
"\eue\e": "↔"
"\ede\e": "→"

"\escA\e": "𝒜"
"\escB\e": "ℬ"
"\escC\e": "𝒞"
"\escD\e": "𝒟"
"\escE\e": "ℰ"
"\escF\e": "ℱ"
"\escG\e": "𝒢"
"\escH\e": "ℋ"
"\escI\e": "ℐ"
"\escJ\e": "𝒥"
"\escK\e": "𝒦"
"\escL\e": "\\[ScriptCapitalL]"
"\escM\e": "\\[ScriptCapitalM]"
"\escN\e": "\\[ScriptCapitalN]"
"\escO\e": "\\[ScriptCapitalO]"
"\escP\e": "\\[ScriptCapitalP]"
"\escQ\e": "\\[ScriptCapitalQ]"
"\escR\e": "\\[ScriptCapitalR]"
"\escS\e": "𝒮"
"\escT\e": "\\[ScriptCapitalT]"
"\escU\e": "\\[ScriptCapitalU]"
"\escV\e": "\\[ScriptCapitalV]"
"\escW\e": "\\[ScriptCapitalW]"
"\escX\e": "\\[ScriptCapitalX]"
"\esCy\e": "\\[ScriptCapitalY]"
"\esCz\e": "\\[ScriptCapitalZ]"
12 changes: 8 additions & 4 deletions mathicsscript/settings.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,19 @@
(**********************************************************************)


Settings`$ShowFullFormInput::usage = "If this variable is set nonzero, mathicsscript shows the input in FullForm before evaluation.
Settings`$ShowFullFormInput::usage = "If this Boolean variable is set True, mathicsscript shows the input in FullForm before evaluation.
Note this is for input entered, not the output of the evaluated result.
"

Settings`$ShowFullFormInput = False
Settings`$PygmentsStyle::usage = "This sets the Pygments style used to colorize output. The value should be a string.
Settings`$PygmentsStyle::usage = "This variable sets the Pygments style used to colorize output. The value should be a string.
The default value changes background depending on whether the terminal has a light or dark background. You can also set the color style used on the command with the ``--style`` option, or look at the variable ```Settings`PygmentsStylesAvailable```. Or it can be set in the settings.m file."

Settings`$PygmentsShowTokens::usage = "Setting this True will show Pygments tokenization of the output."
Settings`$UseUnicode::usage = "Setting this False wil1 avoid unicode in output. The default is to use Unicode."
Settings`$PygmentsShowTokens::usage = "Setting this variable True will show Pygments tokenization of the output."

Settings`$PygmentsShowTokens = False

Settings`$PygmentsStyle::usage = "This Boolean variable sets whether Unicode is used in terminal input and output."
Settings`$UseUnicode = True
3 changes: 2 additions & 1 deletion mathicsscript/termshell.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
from term_background import is_dark_background

from readline import (
parse_and_bind,
read_history_file,
read_init_file,
set_completer,
Expand Down Expand Up @@ -155,7 +156,7 @@ def __init__(
)
read_init_file(str(parent_dir / inputrc))

# parse_and_bind("tab: complete")
parse_and_bind("tab: complete")
self.completion_candidates = []

# History
Expand Down

0 comments on commit 47ae86b

Please sign in to comment.