Is there a way to disable scrolling through command history for the Xfce terminal? I don’t wish to rely on palm rejection, I’d just like it disabled when I’m using the terminal. Specifically I’m talking about not cycling through previous commands at the prompt when scrolling with mouse/touchpad.
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
You are describing the feature of VTE (used in XFCE Terminal) which translates wheel-mouse scrolling into up/down cursor-keys when using the alternate-screen. That happens if you are running screen in something like xterm. You can avoid that by preventing screen from using the terminal’s alternate screen feature.
For example (see How to disable alternate buffer in GNU screen itself but not for vim, less inside it?), tell screen that the feature does not exist (by putting this in .screenrc):
termcapinfo xterm <a href="https://getridbug.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="c0b4a980">[email protected]</a>:<a href="https://getridbug.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="35415075">[email protected]</a>
A similar workaround is used for tmux (see Properly disable terminal capabilities for alternate screen in tmux), putting this in .tmux.conf:
set -ga terminal-overrides ',xterm*:<a href="https://getridbug.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="9fecf2fceaefdf">[email protected]</a>:<a href="https://getridbug.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="35475856404575">[email protected]</a>'
This translation of scrolling behavior does not appear to be configurable in VTE-based terminals. It is configurable in xterm, e.g., alternateScroll (patch #282).
Further reading:
- Make screen work like a terminal (scrolling + alternate screen)
- Fixing the alternate screen problem (one of many pages pro/con)
- Why doesn’t the screen clear when running vi?
Method 2
In the Edit > Preferences menu of xfce4-terminal you can disable the scrollbar.
If you set the scrollback value to 1, it will disable scrolling back using the scroll wheel on your mouse.
I’m using xfce4-terminal 0.6.3, the default version for Ubuntu 14.04.
Method 3
I was just having this same problem using iTerm on my Mac. Whenever I would use the screen feature I was unable to scroll up/down, super annoying.
To disable the command line history on-scroll, do the following:
-
Open
Preferencesand click onAdvancedtab -
Scroll down to the
Mousesection, or search for “scroll” -
Locate option
Scroll wheel sends arrow keys when in alternate screen modeand select No from the dropdown
And you’re all set!
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0