Bug 159340

Summary: "less" command o/p cannot scroll with mouse wheel in konsole
Product: [Applications] konsole Reporter: prakash <pjkonweb>
Component: generalAssignee: Konsole Developer <konsole-devel>
Status: RESOLVED FIXED    
Severity: wishlist CC: davidben
Priority: NOR    
Version: 1.6.6   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description prakash 2008-03-15 06:31:21 UTC
Version:           1.6.6 (using KDE 3.5.9)
Installed from:    Compiled From Sources
OS:                Linux

I am using archlinux which is uptodate with kde(kdemod) 3.5.9,qt version:3.3.8b and konsole version: 1.6.6

The problem I face is,in konsole,I can't scroll with middle mousewheel through the output of "less"(pager) command .
For eg: "less /etc/group" where I have to use keyboard to scroll through.

In gnome-terminal we can scroll with mousewheel through the output of "less" command fine.

Even,in konsole when using vim or nano editors,I can use mousewheel to scroll through the file contents.

So,Please fix this issue with "less" pager in konsole.
 Thanks.
Comment 1 prakash 2008-03-15 06:33:01 UTC
Here is a discussion on the same bug(or wishlist?):-

http://www.linuxquestions.org/questions/linux-software-2/less-command-output-i-cannot-scroll-through-it-627821/
Comment 2 Constantin Berzan 2008-03-15 13:12:09 UTC
gnome-terminal does a funny thing when the foreground program is interactive (i.e. like vim, nano, less) and uses the alternate screen (with the scrollbar disabled): it translates mouse wheel events into up-arrow and down-arrow keyboard events.
Whether we want this behavior in Konsole, I don't know.
Comment 3 prakash 2008-03-15 18:46:32 UTC
well,Konsole already supports scrolling with mouse wheel on vim and nano like editors.then why NOT "less"?it is the most commonly used pager!
Please do enable konsole the "capabilities" :p Thanks!
Comment 4 Robert Knight 2008-03-17 18:34:56 UTC
*** Bug 157174 has been marked as a duplicate of this bug. ***
Comment 5 Matthew Woehlke 2008-03-17 20:36:44 UTC
I suspect this is a matter of telling 'less' to use the alternate screen instead of the primary screen... i.e. it depends on what TERM is set to. (At least that seems to be the case based on my experience with terminal emulation on Cygwin.)
Comment 6 Robert Knight 2008-03-17 23:22:01 UTC
SVN commit 786780 by knight:

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  


WebSVN link: http://websvn.kde.org/?view=rev&revision=786780