> Framing it as a less problem is stupid - every "file manager" of every kind is doing this to some extent - all DEs, everything that uses mailcap, etc.
That's true, but DEs have a lot more eyes and a lot more security scrutiny than less
, which has exactly one developer. I mean, the bug and feature request page for less
appears to be a hand-written static HTML table.
Are you going to tell me that you knew that less
was an attack vector? That this was an obvious attack vector? A program that's literally just more
with extensions (and on some distros completely replaces more
entirely, IIRC)?
> [I] sys-apps/less > > Available versions: 458 (~)474 (~)475 {pcre unicode} > Installed versions: 475(21:50:52 10.03.2015)(pcre unicode) > Homepage: http://www.greenwoodsoftware.com/less/ > Description: Excellent text file viewer
I'm sure there are higher ones, too lazy to search right now.
I guess I could always get the source myself from GNU or its creator here: http://www.greenwoodsoftware.com/less/
And I guess I could always compile/install it in my user's home directory But it is more a matter of policy I think.
It's completely up to the programmer. There are no requirements or rules. There exist projects that are more than 20 years old that are still on version 0.xx, and there are projects that are less than ten years old that are on version 41.something. There are even projects that don't have a minor version at all, and instead have just a single number that increments for each release. (Example: less is currently at version 471.)
Skimming all the 5 commonly-available text pagers (more, less, most, pg, lv), there doesn't seem to be bookmark support in any of them.
There's almost a way to do this in less, by using the LESSOPEN and LESSCLOSE environment variables, but it still will boil down to needing source code changes. Instead of adding full bookmark support, a ghetto solution is to write a wrapper script using LESSOPEN that passes the less command '+gNN' to go directly to line NN, modify 'less' itself to optionally call its LESSCLOSE script with an additional argument with the current line number (via an --option), and then have the LESSCLOSE script itself stash that back into an .rc file for reading. Shell-assisted bookmarking, basically. Better to have proper bookmark support, but it'd probably work.
There's an outstanding ticket on the 'less' bug tracker for adding bookmarks:
http://www.greenwoodsoftware.com/less/bugs.html#enhance
But it's been there a while.
The most awesome thing about Linux, though, is that it and most of its tools are open source, and thus anybody can work on it! I'm sure the maintainer would love a patch..
WOW! this is useful!
​
my less dont do this :(
less -V less 487 (GNU regular expressions) Copyright (C) 1984-2016 Mark Nudelman
less comes with NO WARRANTY, to the extent permitted by law. For information about the terms of redistribution, see the file named README in the less distribution. Homepage: http://www.greenwoodsoftware.com/less
Specifically, this is <code>more</code>.
It is one of the Linux userspace components that wasn't based on a GNU component, and hence is still maintained by a Linux-branded rather than GNU-branded project (the corresponding GNU component being, of course, <code>less</code>). Going by its University of California copyright and mentions of UCB in the changelog, it seems to be ultimately derived from a BSD component.
This is hard to tell from the version string:
yosemite $ which less /usr/bin/less yosemite $ less --version less 418 Copyright (C) 1984-2007 Mark Nudelman
less comes with NO WARRANTY, to the extent permitted by law. For information about the terms of redistribution, see the file named README in the less distribution. Homepage: http://www.greenwoodsoftware.com/less
According to the less release notes it's only about one version behind (edit: one version behind the & that is). It's interesting that less 418 already changed the license to GPL3, so I assume that won't become more of an issue later.
> OK, text-VIEWER, sorry.
See, it's this type of detail that is lost on people who suggest changing some very core pieces of the Linux CLI. Also just FYI, less
is known as a 'pager.' There are many others like it, but 'less' is one of the most common.
I actually quite like change. It's part of the reason I work in the field I do. Things change all the time.
But here's the problem: CTRL+C does not equal "quit program", it is an interrupt. For many programs, this means exit. For things like less
and vim
, it means stop whatever operation you were previously doing. Ever try to load an extremely large text file with less
and have to wait for it to calculate line numbers? You can use CTRL+C to abort that operation and read the file without line numbers enabled. Emacs also ignores CTRL+C by default. For more, see the following: http://www.greenwoodsoftware.com/less/faq.html#ctrlc
> Make new versions and have those be the new standard.
Feel free. Good luck getting sites who have been running stable systems for decades to switch. If you want to develop new tools for the desktop, you can. That's the beauty of Linux. But you can rest assured that it will be an extremely difficult job proving you know what you're doing to millions of existing users and admins.