diff --git a/cmd2.py b/cmd2.py
index 3755ef56..13169a17 100755
--- a/cmd2.py
+++ b/cmd2.py
@@ -1610,8 +1610,11 @@ class Cmd(cmd.Cmd):
         if arg:
             # If a character indicating a slice is present, retrieve a slice of the history
             if '..' in arg or ':' in arg:
-                # Get a slice of history
-                history = self.history.span(arg)
+                try:
+                    # Get a slice of history
+                    history = self.history.span(arg)
+                except IndexError:
+                    history = self.history.get(arg)
             else:
                 # Get item(s) from history by index or string search
                 history = self.history.get(arg)

Unhandled exception in history command introduced by recent changes
A bug was introduced by the recent changes which merged the list functionality into the history command.

When attempting to do a span of history indices, an index error can occur and that exception needs to be caught and default history behavior needs to occur at that point instead.
diff --git a/tests/test_cmd2.py b/tests/test_cmd2.py
index 5783d944..2198d5c0 100644
--- a/tests/test_cmd2.py
+++ b/tests/test_cmd2.py
@@ -206,6 +206,17 @@ shortcuts
 """)
     assert out == expected
 
+def test_history_with_span_index_error(base_app):
+    run_cmd(base_app, 'help')
+    run_cmd(base_app, 'help history')
+    run_cmd(base_app, '!ls -hal :')
+    out = run_cmd(base_app, 'history "hal :"')
+    expected = normalize("""
+-------------------------[3]
+!ls -hal :
+""")
+    assert out == expected
+
 
 def test_base_cmdenvironment(base_app):
     out = run_cmd(base_app, 'cmdenvironment')

pip install -e .
parse_log_pytest
requirements.txt
pytest mock sphinx sphinx-rtd-theme pytest-xdist pytest-cov
3.6
requirements/base.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
alabaster==0.7.13
attrs==22.2.0
Babel==2.11.0
certifi==2021.5.30
charset-normalizer==2.0.12
-e git+https://github.com/python-cmd2/cmd2.git@ccef0b4193297c0b88e8add373f6a49126ffe772#egg=cmd2
coverage==6.2
docutils==0.18.1
execnet==1.9.0
idna==3.10
imagesize==1.4.1
importlib-metadata==4.8.3
iniconfig==1.1.1
Jinja2==3.0.3
MarkupSafe==2.0.1
mock==5.2.0
packaging==21.3
pluggy==1.0.0
py==1.11.0
Pygments==2.14.0
pyparsing==3.1.4
pytest==7.0.1
pytest-cov==4.0.0
pytest-xdist==3.0.2
pytz==2025.2
requests==2.27.1
six==1.17.0
snowballstemmer==2.2.0
Sphinx==5.3.0
sphinx-rtd-theme==2.0.0
sphinxcontrib-applehelp==1.0.2
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-htmlhelp==2.0.0
sphinxcontrib-jquery==4.1
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.5
tomli==1.2.3
typing_extensions==4.1.1
urllib3==1.26.20
zipp==3.6.0

name: cmd2
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2021.5.30=py36h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.3=he6710b0_2
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=21.2.2=py36h06a4308_0
  - python=3.6.13=h12debd9_1
  - readline=8.2=h5eee18b_0
  - setuptools=58.0.4=py36h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.37.1=pyhd3eb1b0_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - alabaster==0.7.13
      - attrs==22.2.0
      - babel==2.11.0
      - charset-normalizer==2.0.12
      - coverage==6.2
      - docutils==0.18.1
      - execnet==1.9.0
      - idna==3.10
      - imagesize==1.4.1
      - importlib-metadata==4.8.3
      - iniconfig==1.1.1
      - jinja2==3.0.3
      - markupsafe==2.0.1
      - mock==5.2.0
      - packaging==21.3
      - pluggy==1.0.0
      - py==1.11.0
      - pygments==2.14.0
      - pyparsing==3.1.4
      - pytest==7.0.1
      - pytest-cov==4.0.0
      - pytest-xdist==3.0.2
      - pytz==2025.2
      - requests==2.27.1
      - six==1.17.0
      - snowballstemmer==2.2.0
      - sphinx==5.3.0
      - sphinx-rtd-theme==2.0.0
      - sphinxcontrib-applehelp==1.0.2
      - sphinxcontrib-devhelp==1.0.2
      - sphinxcontrib-htmlhelp==2.0.0
      - sphinxcontrib-jquery==4.1
      - sphinxcontrib-jsmath==1.0.1
      - sphinxcontrib-qthelp==1.0.3
      - sphinxcontrib-serializinghtml==1.1.5
      - tomli==1.2.3
      - typing-extensions==4.1.1
      - urllib3==1.26.20
      - zipp==3.6.0
prefix: /opt/conda/envs/cmd2

tests/test_cmd2.py::test_history_with_span_index_error
tests/test_cmd2.py::test_output_redirection
tests/test_cmd2.py::test_ver tests/test_cmd2.py::test_base_help tests/test_cmd2.py::test_base_help_history tests/test_cmd2.py::test_base_shortcuts tests/test_cmd2.py::test_base_show tests/test_cmd2.py::test_base_show_long tests/test_cmd2.py::test_base_set tests/test_cmd2.py::test_base_set_not_supported tests/test_cmd2.py::test_base_shell tests/test_cmd2.py::test_base_py tests/test_cmd2.py::test_base_run_python_script tests/test_cmd2.py::test_base_error tests/test_cmd2.py::test_base_history tests/test_cmd2.py::test_history_with_string_argument tests/test_cmd2.py::test_history_with_integer_argument tests/test_cmd2.py::test_history_with_integer_span tests/test_cmd2.py::test_history_with_span_start tests/test_cmd2.py::test_history_with_span_end tests/test_cmd2.py::test_base_cmdenvironment tests/test_cmd2.py::test_base_load tests/test_cmd2.py::test_base_load_default_file tests/test_cmd2.py::test_base_relative_load tests/test_cmd2.py::test_base_save tests/test_cmd2.py::test_allow_redirection tests/test_cmd2.py::test_input_redirection tests/test_cmd2.py::test_pipe_to_shell tests/test_cmd2.py::test_send_to_paste_buffer tests/test_cmd2.py::test_base_timing tests/test_cmd2.py::test_base_debug tests/test_cmd2.py::test_base_colorize tests/test_cmd2.py::test_edit_no_editor tests/test_cmd2.py::test_edit_file tests/test_cmd2.py::test_edit_number tests/test_cmd2.py::test_edit_blank tests/test_cmd2.py::test_base_py_interactive tests/test_cmd2.py::test_base_cmdloop_with_queue tests/test_cmd2.py::test_base_cmdloop_without_queue tests/test_cmd2.py::test_cmdloop_without_rawinput
cmd2.py
cmd2.py