Skip to content

Conversation

@kyanagi
Copy link
Contributor

@kyanagi kyanagi commented Jan 9, 2025

If the original value of LESS ends with an option starting with --, simply appending Fe would result in an invalid option string.

% LESS=--RAW-CONTROL-CHARS ruby -roptparse -e 'OptionParser.new.parse(ARGV)' -- --help
There is no RAW-CONTROL-CHARSFe option ("less --help" for help)
Press RETURN to continue

As far as I have tested, it seems that LESS can safely contain preceding spaces.

If the original value of LESS ends with an option starting with "--",
simply appending "Fe" would result in an invalid option string.
@fzakaria
Copy link

fzakaria commented Feb 9, 2025

I just hit this as I use the following in my Nix configuration:

  home.sessionVariables = {
    LESS = "--quit-if-one-screen --RAW-CONTROL-CHARS";
    EDITOR = "vim";
    # TODO(fmzakari): I might want this if I use home-manager on Linux non-NixOS
    # https://nixos.org/manual/nixpkgs/stable/#locales
    # LOCALE_ARCHIVE = "${pkgs.glibcLocales}/lib/locale/locale-archive";
  };

Thanks for opening the issue; it saved me some hair pulling.

@nobu nobu merged commit 30571f9 into ruby:master Mar 10, 2025
@kyanagi kyanagi deleted the fix-help-less-env branch March 10, 2025 11:00
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.

3 participants