Skip to content
Merged
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
7 changes: 5 additions & 2 deletions cmd2/cmd2.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
Table,
)
from rich.text import Text
from rich.traceback import Traceback

from . import (
argparse_completer,
Expand Down Expand Up @@ -1357,12 +1358,14 @@ def pexcept(

# Only print a traceback if we're in debug mode and one exists.
if self.debug and sys.exc_info() != (None, None, None):
console.print_exception(
width=console.width,
traceback = Traceback(
width=None, # Use all available width
code_width=None, # Use all available width
show_locals=True,
max_frames=0, # 0 means full traceback.
word_wrap=True, # Wrap long lines of code instead of truncate
)
console.print(traceback)
console.print()
return

Expand Down
Loading