You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
mathicsscript starts in Emacs mode if I start it with mathicsscript or mathicsscript --readline Prompt. If I start it with mathicsscript --readline GNU it reads my ~/.inputrc file and hence respects my preferred edit mode. But there is no such configuration file for prompt_toolkit as far as I can tell. I would need to insert code into mathicsscript to enable the switch.
Describe the solution you'd like
I would like a command-line option to either (A) enable Vi-mode at startup, or (B) enable a fragment of python code to be inserted after startup but before interactivity becomes available. The fragment I would want to run would be something like app.editing_mode = EditingMode.VI but it depends on the termshell_prompt.py file having already imported EditingMode from prompt_toolkit.enums and, of course, prompt_toolkit remaining the default.
Describe alternatives you've considered
I have included the code mentioned above in termshell_prompt.py after line 162. That's fine until mathicsscript is updated! Then I have to add it again, possibly in a different place. Another alternative is to use GNU readline, which would respect my .inputrc file, but that provides a much worse user experience in terms of syntax highlighting and autocompletion than does prompt_toolkit.
Additional context
I'm afraid option (A) may become obsolete if prompt_toolkit gains a configuration file, but option (B) might be more long-lived, although it could also be abused.
I searched for such a feature in the documentation and it may be there since, as a newb, I don't fully understand the documentation. It seems that the options for adding files and expressions all require valid mathics expressions, not raw Python code. I see that there is a "Python extensions" directory but can find no documentation about it.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
mathicsscript starts in Emacs mode if I start it with
mathicsscript
ormathicsscript --readline Prompt
. If I start it withmathicsscript --readline GNU
it reads my~/.inputrc
file and hence respects my preferred edit mode. But there is no such configuration file forprompt_toolkit
as far as I can tell. I would need to insert code into mathicsscript to enable the switch.Describe the solution you'd like
I would like a command-line option to either (A) enable Vi-mode at startup, or (B) enable a fragment of python code to be inserted after startup but before interactivity becomes available. The fragment I would want to run would be something like
app.editing_mode = EditingMode.VI
but it depends on thetermshell_prompt.py
file having already importedEditingMode
fromprompt_toolkit.enums
and, of course,prompt_toolkit
remaining the default.Describe alternatives you've considered
I have included the code mentioned above in
termshell_prompt.py
after line 162. That's fine until mathicsscript is updated! Then I have to add it again, possibly in a different place. Another alternative is to use GNUreadline
, which would respect my.inputrc
file, but that provides a much worse user experience in terms of syntax highlighting and autocompletion than doesprompt_toolkit
.Additional context
I'm afraid option (A) may become obsolete if
prompt_toolkit
gains a configuration file, but option (B) might be more long-lived, although it could also be abused.I searched for such a feature in the documentation and it may be there since, as a newb, I don't fully understand the documentation. It seems that the options for adding files and expressions all require valid mathics expressions, not raw Python code. I see that there is a "Python extensions" directory but can find no documentation about it.
The text was updated successfully, but these errors were encountered: