How can I setup GNU screen to allow the mouse's scrollwheel to scroll around in the scrollback buffer? I tried to Google about this, but most hits where on how to allow applications inside screen to use the scrollwheel.
相关问题
- How can I stop VI from overlapping and hiding the
- How can I get currently attached screen session na
- GNU Screen: Environment variables
- How to disable scrolling in NSScrollView with enab
- How to preserve emacs colors from regular terminal
相关文章
- GNU Screen: Environment variables
- How to disable scrolling in NSScrollView with enab
- How to preserve emacs colors from regular terminal
- Use gdb to debug MPI in multiple screen windows
- Checking if a Screen of the Specified Name Exists
- Windows equivalent for Linux “screen” or another a
- Unix screen utility error: Cannot find termcap ent
- How do I get the command history in a screen sessi
For OS X (Snow Leopard), the following worked for me:
http://slaptijack.com/system-administration/mac-os-x-terminal-and-gnu-screen-scrollback/
Briefly, it involves adding the following to ~/.screenrc on the remote host (the one you're running screen on):
The following worked for me in both Cygwin and Putty: Edit .screenrc and add
The solution when using "Ubuntu 16.04.2 LTS" is as follows:
a). Update $HOME/.screenrc as previous answers have specified:
b). Use "Settings"."Preferred Applications" to alter the default terminal to xterm, by selecting the "X Terminal" one in the drop-down list.
Some superfluous notes
None of the other terminals, including installing "lxterminal", worked for me, even when I altered the termcapinfo line to "*" instead of "xterm*".
By clicking the menu button in the top-left corner of the screen, you can get the Settings dialog using the 3rd icon from the bottom right corner.
The excellent article that Jon Z is referring to is no longer available, but I was able to fish the text-only version of it from the Google cache. I'm saving it here in case Google drops that as well in the future. Original post was by Mikael Ståldal so credit where credit is due.
--
How to use mousewheel in GNU Screen
GNU Screen has support for scrollback, but by default you have to use awkward keys to use it. I would like to be able to use Shift-PageUp, Shift-PageDown and the mousewheel to scroll, just like you can do in xterm.
It was not easy to configure Screen for this, and it involves cooperation with the terminal emulator. But I finally managed to achieve a solution which works pretty well. Add this to your ~/.Xresources file (you need to log out for this to take effect):
Then add this to your ~/.screenrc file:
This works in xterm. I’m not sure if it works in other terminal emulators.
Note that this disables the normal scrolling support in xterm, you will only be able to scroll when using Screen. You might want to start xterm like this to always use Screen:
And to use the scrollwheel in a VIM inside GNU Screen:
[.vimrc]
I believe you can just add a line like this to your
~/.screenrc
:Where "xterm*" is a glob match of your current TERM. To confirm it works, ^A^D to detach from your screen, then
screen -d -r
to reattach, thenls
a few times, and try to scroll back. It works for me.What is this magic? Well, let's consult the manual pages.
screen(1)
says:From
termcap(5)
: