Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion mathicsscript/__main__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
#!/usr/bin/env python3
# Copyright (C) 2025 Rocky Bernstein <[email protected]>
# -*- coding: utf-8 -*-
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

import os
import os.path as osp
Expand Down
3 changes: 2 additions & 1 deletion mathicsscript/completion.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-

# Copyright (C) 2021-2022, 2024 Rocky Bernstein <[email protected]>
# Copyright (C) 2021-2022, 2024-2025 Rocky Bernstein <[email protected]>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
Expand Down Expand Up @@ -67,6 +67,7 @@ class InterruptCompleter(Completer):
COMMANDS = [
"abort",
"continue",
"debugger",
"exit",
"inspect",
"show",
Expand Down
16 changes: 16 additions & 0 deletions mathicsscript/interrupt.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# Copyright (C) 2025 Rocky Bernstein <[email protected]>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
mathicsscript Interrupt routines.

Expand Down Expand Up @@ -108,6 +121,8 @@ def Mathics3_interrupt_handler(
elif user_input in ("continue", "c"):
print_fn("continuing")
break
elif user_input in ("debugger", "d"):
breakpoint()
elif user_input in ("exit", "quit"):
print_fn("Mathics3 exited because of an interrupt.")
sys.exit(3)
Expand Down Expand Up @@ -138,6 +153,7 @@ def Mathics3_interrupt_handler(
"""Your options are:
abort (or a) to abort current calculation
continue (or c) to continue
debugger (or d) to to enter a Python debugger
exit (or quit) to exit Mathics3
inspect (or i) to enter an interactive dialog
show (or s) to show current operation (and then continue)
Expand Down
2 changes: 1 addition & 1 deletion mathicsscript/termshell_gnu.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def complete_interrupt_command(self, text, state):
# Only complete from this fixed set
completions = [
w
for w in ["abort", "continue", "exit", "inspect", "show"]
for w in ["abort", "continue", "debugger", "exit", "inspect", "show"]
if w.startswith(text)
]
try:
Expand Down
Loading