Can mouse wheel scrolling work in a Screen session?
Solution 1
Mouse scrolling and elevators will work if you enable them in your .screenrc.
Q: My xterm scrollbar does not work with screen.
A: The problem is that xterm will not allow scrolling if the alternate text buffer is selected. The standard definitions of the termcap initialize capabilities ti and te switch to and from the alternate text buffer. (The scrollbar also does not work when you start e.g. 'vi'). You can tell screen not to use these initialisations by adding the line termcapinfo xterm ti@:te@ to your ~/.screenrc file.
So in my .screenrc, I have:
termcapinfo xterm* ti@:te@
In tmux, it'd be something like (.tmux.conf):
set -g terminal-overrides 'xterm*:smcup@:rmcup@'
Solution 2
Although it is an old question, the method I found best that works for me is using Ctrl + A + ESC
key combination. This makes the screen output scrollable. From the documentation page:
Virtual terminals in Screen can be manipulated by pressing the Ctrl+A key combination, and subsequently pressing a key to execute one of the commands given below:
Esc lets you scroll back and forth in your terminal output
You can find the documentation here
Solution 3
That's not the final solution, if you use this
termcapinfo xterm* ti@:te@
then the mouse scroll support will be broken inside vim
i.e. mouse=vi
Solution 4
What Gilles suggested is probably the best answer, if it is possible to do.
If it is not, a workaround that should work would be to use x-mouse control to send up and down arrow keys whenever the mouse is scrolled. I've never used screens with putty, but I have used this setup on putty in windows to be able to scroll through a text file with vi or nano. I had different profiles setup, one for 3 line scroll and one for 1 line scroll.
Solution 5
Mouse scroll wheel works well with for example elinks running inside screen, which in turns runs inside gnome-terminal, so it is indeed possible. In putty tray it doesn't, tho.
Related videos on Youtube
kristi
Updated on September 18, 2022Comments
-
kristi over 1 year
Is there any way to use the mouse wheel to scroll through the output of a
screen
session?I can use the keypad scroll through previous output in
screen
after pressingctrl+a [
. Is it possible to do this with the mouse wheel?(I'm using
putty
, but I don't think it's aputty
issue, I believe it's ascreen
issue.)-
Gilles 'SO- stop being evil' almost 13 yearsYou need to tell PuTTY to send the mouse wheel events into the terminal instead of keeping them for itself. (I don't know if it's possible, but check the manual, it's pretty good.)
-
Naftuli Kay almost 13 yearsEven on a regular terminal session in
screen
, I haven't been able to get scrolling working properly outside ofscreen
's "copy mode." I think it's a limitation of the program and not so much a Windows/Putty issue, but I could be wrong. -
tcoolspy almost 13 yearsOur of curiosity, have you guys tried the same thing in
tmux
? -
Torian over 12 years@Caleb: mouse wheel on
tmux
works like a charm (although I'm not trying it from a putty, I don't have windows:))
-
-
kristi almost 13 yearsWhen I'm using vim, I have
set mouse=a
to enable mouse scrolling. This works in putty without using screen, but it doesn't work when using screen. How do you set up x-mouse control? -
Eric almost 13 yearsjust visit the website and download the software, it's pretty self explanatory. It's a GUI app.
-
fbence over 7 yearsWould it be possible to edit
.screenrc
so that when you entervim
this is turned off and turned back on when exiting? -
andrej almost 6 yearswell, this is acceptable since I nearly do not use mouse scroll in vim anyway
-
Hubert Perron almost 6 yearsThis is a nice answer that point to a builtin screen feature that fix the issue of this question without any configuration change.
-
Kevin McCarpenter over 5 yearsIt's worth mentioning that copy mode (C-a, ESC) pauses any currently-running process in the window in which it was used: superuser.com/questions/220139/…