GithubHelp home page GithubHelp logo

nhaehnle / less Goto Github PK

View Code? Open in Web Editor NEW
13.0 13.0 4.0 489 KB

The well-known pager, with performance improvements for huge files

License: Other

Perl 1.24% C 97.00% C++ 1.29% Shell 0.45% Awk 0.02%

less's People

Contributors

nhaehnle avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

less's Issues

Get variables LESS_TERMCAP_* from lesskey file

The command less skips the variables LESS_TERMCAP_* defined in the lesskey file (e.g. ~/.less).

This is because, the function main() retrieves the variables LESS_TERMCAP_*
before loading of the lesskey file. I propose to just invert two lines.

I explain that in details on this site:
https://unix.stackexchange.com/a/377221/13999

This is the current source code at line 110 in main.c

/*
 * Process command line arguments and LESS environment arguments.
 * Command line arguments override environment arguments.
 */
is_tty = isatty(1);
get_term();
init_cmds();
init_charset();
init_line();

This is the fix I have validated on my computer:

/*
 * Process command line arguments and LESS environment arguments.
 * Command line arguments override environment arguments.
 */
is_tty = isatty(1);
init_cmds();         /* Load lesskey file before */
get_term();          /* getting variables LESS_TERMCAP_* */
init_charset();
init_line();

I have just inverted two lines: get_term(); and init_cmds();

Questions:

  • Do you want a pull request ?
  • Do you want to follow bug-fixes from upstream project ?

For information I have sent the same bug report a fix proposal to the less mainteners.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.