"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.
Notices
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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!
@ararus:I tried
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
To escape,I echoed:
echo -e '\e[?1000l'
@exit3219:but even nano editor also allows mouse scrolling :?
@Tinkster:why are u getting offended?I am not in a raw into bumping JFYI.cool down!dont use ur time to cr@p this thread.stop this behaviour,atleast ur a mod(?).
@ararus:I tried
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.
Default actions:
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.
BUG: 159340
M +36 -1 TerminalDisplay.cpp
M +3 -0 TerminalDisplay.h
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.