Skip to content

fix: add -R flag to less for LESS_TERMCAP color support#9

Closed
TunaCuma wants to merge 1 commit intomainfrom
fix/less-termcap-colors
Closed

fix: add -R flag to less for LESS_TERMCAP color support#9
TunaCuma wants to merge 1 commit intomainfrom
fix/less-termcap-colors

Conversation

@TunaCuma
Copy link
Owner

@TunaCuma TunaCuma commented Jan 4, 2026

Summary

Fixes #1

Adds the -R flag to all less invocations in zvm_open_less() to enable raw escape sequence passthrough.

Problem

Users who rely on LESS_TERMCAP_* environment variables for man page colors were not seeing colors when using this plugin. This is because:

  1. The plugin sets MANPAGER=cat to capture raw man output
  2. The output is piped to less without the -R flag
  3. Without -R, less doesn't pass through ANSI escape sequences needed for color display

Solution

Add -R flag to all less calls, which tells less to interpret raw control characters. This enables:

  • LESS_TERMCAP_* color variables to work correctly
  • ANSI color codes from man pages to display properly

Changes

  • lib/pager.zsh: Added -R flag to all ${ZVM_MAN_PAGER} invocations in zvm_open_less()

@TunaCuma TunaCuma closed this Mar 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

How to get man page colors working?

1 participant