Skip to content

Inconsistent behaviour in SystemRegistryImpl #1232

@Elec332

Description

@Elec332

Every form of command exection/checking first checks if the sub-registries can handle a command, then check if it is a local command if it does not exist later, and then if it is a potential console command.

There is one outlier, and that is https://github.com/gnodet/jline3/blob/d63b3efce6c730c15554a0a71997fb974de4bffb/console/src/main/java/org/jline/console/impl/SystemRegistryImpl.java#L1233
(local -> custom -> scripts)
Here the local check is done first, before checking for local commands later. This unfortunately makes it impossible to (temporarily) override builtin commands like exit and clear.

Other check examples (pretty consistent):
https://github.com/gnodet/jline3/blob/d63b3efce6c730c15554a0a71997fb974de4bffb/console/src/main/java/org/jline/console/impl/SystemRegistryImpl.java#L414
(custom -> local -> console)
https://github.com/gnodet/jline3/blob/d63b3efce6c730c15554a0a71997fb974de4bffb/console/src/main/java/org/jline/console/impl/SystemRegistryImpl.java#L341
(custom -> scripts -> local)
https://github.com/gnodet/jline3/blob/d63b3efce6c730c15554a0a71997fb974de4bffb/console/src/main/java/org/jline/console/impl/SystemRegistryImpl.java#L214
(custom -> scripts -> local)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions