Skip to content

Add help page information to the less pager prompt again #16913

@EliteTK

Description

@EliteTK

Summary

When using less to view help pages, uv should use the LESS variable to set the prompt (-P) in a fail-safe way (either works or is silently ignored) to tell the user they're viewing uv help output and the command for which they're viewing it.

The LESS variable follows an odd format and may already have things in it (user specific customization). The prompt value may need to be cleaned/escaped for this.

Background: Previously uv would try to set the less prompt to: "uv help: ". However, busybox less would break when passed -P, breaking the paging functionality (#16015). It was also spotted that everything after and including the colon was being dropped which meant that this feature wasn't serving its intended purpose. #16908 removed -P to avoid triggering the busybox issue.

Example

Running uv help run and scrolling down, a user would continue to see information about the current page in the prompt (bottom left corner):

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or improvement to existing functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions