"less" command output-I cannot scroll through it !
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
So,konsole doesnot support scrolling through "less" output.
@ararus:will try that!
most of the time I am on Debian Sid(Gnome-2.22),but with archlinux+kdemod,konsole is becoming a PITA.
guess,I have to search for some alternate terminals.
also,will try to post this in konsole(kde) BTS maybe!
echo -e '\e[?1000h'.I opened a file with "less" and tried mouse to scroll-but that brings the "help" message of "less" command.
also after echoing above thing,when I use mouse inside konsole,it just prints some hex messages and "beep" sound
Yes, that's what I said would happen, it merely prints the raw escape sequences to the console. That's Phase 1. Phase 2 is getting the relevant application to interpret those escape sequences properly, less isn't going to magically understand those escape sequences just because you told the terminal to print them. While less has configurable key bindings, the escape sequences contain the x/y coordinates on screen, so less will need to be modified to understand the sequences.
I used the current version, 418, it may work with other versions, but you might as well get the latest source.
Define the environment variable LESSUSEMOUSE to enable the mouse.
wheel up/down: scroll half a page
ctrl + wheel: scroll 1 line
alt + wheel: scroll full page (may not work)
button1/button3 will do a next/prev search.
NOTE: Alt+wheel works in rxvt, but not in xterm, but there may be an option to enable it. Don't know about other terminals. The window manager may also eat certain combinations, of course.
NOTE: You'll see I only used Control and Alt, you generally cannot bind Shift since mouse reporting is disabled while Shift is held down (to enable making selections).
You can change the bindings in your lesskey file, section #cmdbutton for command mode, #editbutton for edit mode (the prompt line), key names are the button number (4/5 for wheel), optionally prefixed with 'c' or 'a' (case insensitive) for ctrl/alt.
will swap the behaviour of (plain) wheel and ctrl+wheel.
In edit mode, the wheel will scroll through the search history. None of the other buttons do anything by default, but you can bind them in the #editbutton section, as mentioned above. Using the mouse in edit mode doesn't seem that useful to me, but it has to interpret the escape sequences or the'll just be dumped into the input buffer.
If the terminal application is not interested in mouse events and the display's scroll bar is not movable then send Up/Down key press events to the terminal instead.
This makes it possible to scroll up and down in 'less' and other applications using the mouse wheel. One key press is sent for every 5 degrees of mouse wheel rotation. Typical mouse wheels operate in steps of 15 degrees which equals 3 lines scrolled per notch. This default is the same as Vim's default mouse wheel scroll step.
As in gnome-terminal and others, this has side effects such as the mouse wheel scrolling through history results in the shell if the shell is run in a program such as screen.
M +36 -1 TerminalDisplay.cpp
M +3 -0 TerminalDisplay.h