Tag Info

New answers tagged


Just to add another version on the "use less -r": use the environment variable LESS with the value r (or add r to whatever it already is) eg, as I use it in my .bashrc export LESS=-Xr (The X stops the screen from clearing when exiting less)


You can use option "-# " to set the number of columns for horizontal scrolling. From man page: -# or --shift Specifies the default number of positions to scroll horizontally in the RIGHTARROW and LEFTARROW commands. If the number specified is zero, it sets the default number of positions to one half of the screen width. Example (set horizontal ...


This is by design: programs that produce colored output typically do so only when their output goes to a terminal, not when it's sent to a pipe or to a regular file. The reason is that data sent on a terminal is presumably read by a human, whereas data piped to a program or written to a file is likely to be parsed by some program, so it shouldn't contain ...


I can't comment @jimmij 's answer, because I have less than 50 rep, but I would like to explain what worked for me on bash. If you run man ls | grep color you will see all the entries of the man-page for your specific shell environment (in our case bash). For me the following adjustment did the trick: alias ls='ls -G'


The problem most probably is that your ls has set option --color to auto which basically means that output should be coloured only if it is connected to terminal, otherwise (output connected to a pipe or a file) no colors are emitted. If you want to have colors is such cases you should set --color option to always, so try ls --color=always | less -R If ...


w3m can be a decent pager (though I do prefer less). It supports the mouse (you may need to enable this in the configuration), including scrolling. Vim is a text editor but can be used as a pager: set PAGER='vim -R'. You can enable mouse support with set mouse=a in your ~/.vimrc. The wheel works at least in xterm, I can't vouch for OSX's terminal emulator.


I set my terminal emulator to send arrow keys for the scroll wheel when in alternate screen mode. In iTerm2, that's under Preferences > Advanced and search for "scroll". It doesn't interfere with xterm escape codes when something supports it, but when it does not (like in less), it sends arrow keys instead. Still not a complete solution, but better than ...


It seems this is possible using WoMan in Emacs. According to http://www.emacswiki.org/emacs/WoMan “woman” stands for “w/o man”, ie “without man” and allows you to view man pages without having the “man” program installed. In Emacs enter: M-x woman Where M-x is the Alt key followed by the letter x. You will then be prompted to specify the man page you ...


you can use cat man --pager=cat <page> or you can pipe the man page into cat man <page> | cat


Here's a relevant excerpt from less' FAQ: Can less leave the screen alone when it quits? When less starts, it sends the "ti" termcap string to the terminal, and when it quits, it sends the "te" string. Exactly what the "te" string does depends on the system you are using, the type of terminal, and your version of termcap. On some systems, it ...


To bind Esc+Esc to quit with lesskey, do the following: Create a ~/.lesskey file with the line: \e\e quit Run lesskey. This will create a binary ~/.less file used by less. Use less as usual. Esc+Esc will do a quit. If you no longer want your bindings, you can remove the ~/.less file. For more details, see man lesskey or lesskey.nro in the less ...


Not really. less has many functions bound to ESC + something else. See the manpage: ESCv, ESCn, ESCF, many others. You wouldn't be able to type any of those is less exited upon receiving just ESC. Concievably, you could rebind all those functions to other keystrokes or live with being unable to type them, and rebind ESC to quitting, but it still wouldn't ...

Top 50 recent answers are included