Skip to content

Colorize commands in the REPL #151822

@johnslavik

Description

@johnslavik

Feature or enhancement

clear was not colorized in the REPL, but it shares the same special meaning as exit, quit, copyright, and help (commands you type without parentheses to trigger an action). Those other commands happened to be colorized already, but only because they double as site builtins, not because the REPL recognized them as commands. clear has no such builtin counterpart, so it fell through uncolored. This change introduces a dedicated command color and applies it consistently to all five.

Let's consider making a separate matcher for commands specifically, and colorize all commands, including clear. This will highlight commands differently than built-ins.

If this sounds good, lmk if you have any color preferences. I'm fine with bold cyan.

cc @ambv @pablogsal

Linked PRs

Metadata

Metadata

Assignees

Labels

stdlibStandard Library Python modules in the Lib/ directorytopic-replRelated to the interactive shelltype-featureA feature request or enhancement
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions