GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — cmd.Cmd fails tab completion for lines beginning with `! ` (bang space) · Issue #133363 · python/cpython

cmd.Cmd fails tab completion for lines beginning with ! (bang space) #133363

New issue
Copy link
New issue
Copy link
Closed
Closed
cmd.Cmd fails tab completion for lines beginning with ! (bang space)#133363
Copy link
Labels
type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

@godlygeek
godlygeek
opened on May 4, 2025
Issue body actions

Bug report

Bug description:

As noted in #133351 (comment) PDB allows commands that start with !, but Cmd fails to tab complete them if there's a space after the !, because it falls down this code path:

cpython/Lib/cmd.py

Lines 274 to 280 in 2bc8365

if begidx>0:
cmd, args, foo = self.parseline(line)
if cmd == '':
compfunc = self.completedefault
else:
try:
compfunc = getattr(self, 'complete_' + cmd)

which expects cmd to always be a string, but parsecmd is returning None instead when the line starts with ! and do_shell is not defined.

CPython versions tested on:

CPython main branch

Operating systems tested on:

No response

Linked PRs

  • gh-133363: Fix Cmd completion for lines beginning with !  #133364

Activity

  1. godlygeek
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    on May 4, 2025
  2. gaogaotiantian
    added a commit that references this issue on May 4, 2025

    gh-133363: Fix Cmd completion for lines beginning with `! ` (#133364)

    1d9406e
  3. gaogaotiantian
    closed this as completedon May 4, 2025
  4. diegorusso
    added a commit that references this issue on May 4, 2025

    Merge remote-tracking branch 'origin/main' into call-len

    c03babc
  5. Pranjal095
    added a commit that references this issue on Jul 12, 2025

    pythongh-133363: Fix Cmd completion for lines beginning with `! ` (py…

    1e2eb72
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.