man itself shouldn't know anything about mouse wheel, and the scroll bar of the xfce4-terminal window doesn't change, so...

Did xfce4-terminal send something to the pty master fd when the window captures mouse wheel event from X server?

If yes, what does it write to the pty device to act like I pressed the Down Key?

Or am I completely missing something?

  • This is more a question about the pager that is used by man (probably less?). For example, try man -P cat [manpage] to use cat as a pager. Commented Mar 21, 2019 at 7:53
  • On the other hand, less claims that it does not support mouse wheel scrolling (search for wheel on that page), but it works for me. Strange... Commented Mar 21, 2019 at 7:55

1 Answer 1


Your pager displays its contents in the alternate screen buffer, which selects “alternate scroll mode” (which you can see because the vertical scroll bar changes — it no longer allows scrolling the window contents), and in that mode, the terminal translates mouse wheel movement to cursor up/down controls. This was introduced in XTerm a long time ago and is widely supported in current terminals.

To see what sequence is used to switch to the alternate screen buffer, run

tput smcup | od -a

You should see esc [ ? 1 0 4 9 h. This is what the pager sends to the terminal. is represented by CSI B which the terminal sends to the running application.

If your pager is less, you can disable this by exporting LESS=X to the environment (this skips terminal initialisation).

  • So I am right, when the terminal window receive a key event it DOES write something to the master pty fd? And the programs(the pager) running in the terminal DOESN'T know anything about mouse but just bytes received from pty slave. Commented Mar 21, 2019 at 11:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .